[SDL] Time of screen update?

The Novice Coder programmer at handi.dyndns.org
Tue Feb 14 20:48:14 PST 2012


On 2/14/2012 3:48 PM, Mike Lawrence wrote:
> On Tue, Feb 14, 2012 at 7:06 AM, R Manard<dranikist at gmail.com>  wrote:
>> gotta dumb it down for me. you want the game data to change according to the
>> user pushing buttons but you want whats on the screen to to be more in sync
>> than the refresh rate of the monitor?
> Actually, I'm not coding games per-se, I'm coding experiments in
> cognitive psychology, so my priorities are slightly different than
> those of a game developer. My aim is to present visual stimuli to the
> user and measure, as accurately as possible, the time between the
> moment that the stimulus is actually displayed on the screen and the
> time that the user responds (usually via keyboard or gamepad).
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
Well, what I would do is use boost::cpu_timer after calling SDL_Flip() 
to mark and track the time changes.  It's the most accurate timer I 
know, although not actually SDL.  It gets the job done.

Some info about it is at:
http://www.boost.org/doc/libs/1_48_0/libs/timer/doc/cpu_timers.html

Hope that helps...



More information about the SDL mailing list