Mercurial > mplayer.hg
view osdep/timer-win2.c @ 21318:c012ba4bf229
help messages:
r21306: fix compilation for win32 dll codec support for intel osx
r21328: localization of parser-m*cmd.c messages
r21332: insert line break for overly long line (second line indented)
man page:
r21221: improve description of x264's deadzone* options
r21228: fix typos noticed by Diego
r21254: nits and picks by The Wanderer :)
r21255: typo in deadzone_inter
r21298: "D" interactive key also works with yadif now
author | kraymer |
---|---|
date | Mon, 27 Nov 2006 17:22:31 +0000 |
parents | f9755d9c479a |
children | 8df85ad26746 |
line wrap: on
line source
// Precise timer routines for WINDOWS #include <windows.h> #include <mmsystem.h> #include "timer.h" const char *timer_name = "Windows native"; // Returns current time in microseconds unsigned int GetTimer(){ return timeGetTime() * 1000; } // Returns current time in milliseconds unsigned int GetTimerMS(){ return timeGetTime() ; } int usec_sleep(int usec_delay){ // Sleep(0) won't sleep for one clocktick as the unix usleep // instead it will only make the thread ready // it may take some time until it actually starts to run again if(usec_delay<1000)usec_delay=1000; Sleep( usec_delay/1000); return 0; } static DWORD RelativeTime = 0; float GetRelativeTime(){ DWORD t, r; t = GetTimer(); r = t - RelativeTime; RelativeTime = t; return (float) r *0.000001F; } void InitTimer(){ GetRelativeTime(); }