It is not quite clear what do you mean by "monitor frame".
If you want to measure monitor refresh rate, then there is not much to measure. It's a fixed number, which etirely depends on monitor model and display settings. You can look it up or use win api call to get it programmatically: http://msdn.microsoft.com/en-us/library/dd162611%28v=VS.85%29.aspx. Refrash rate is not affected by your software.
If you want to measure fps, then you need a timer (e.g. StopWatch
) and a frame count. You can get the latter by incrementing some variable each time you refresh the screen. OnPaint
method in your form is propbably one of the places where you can do that. Fps is not affected by monitor (unless you enable VSync).
If you want to measure fps excluding frames which were skipped due to slow refresh rates... Then i think its safe to assume, that this value equals to refresh rate if refresh rate is lower then fps, and it equals to fps if refresh rate is higher then fps.