Search code examples
winformsframe-rate

FPS on WinForms


I write WinForms Application and I want to draw FPS on each of it. Is there any way to get it from window or get number of frames used to draw window in 1 sec?


Solution

  • Your question doesn't make much sense. Winforms uses GDI+ as a graphics engine, which does not mainting a constant redraw loop. Windows are only redrawn as needed when they are invalidated for any reason.

    You can use a System.Diagnostics.StopWatch to measure how long a single iteration of painting takes.

    The inverse of this value is the theoretical frame rate you can achieve.