2 * precise timer routines for Windows
4 * This file is part of MPlayer.
6 * MPlayer is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * MPlayer is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 const char timer_name
[] = "Windows native";
27 // Returns current time in microseconds
28 unsigned int GetTimer(void)
30 return timeGetTime() * 1000;
33 // Returns current time in milliseconds
34 unsigned int GetTimerMS(void)
36 return timeGetTime() ;
39 int usec_sleep(int usec_delay
){
40 // Sleep(0) won't sleep for one clocktick as the unix usleep
41 // instead it will only make the thread ready
42 // it may take some time until it actually starts to run again
43 if(usec_delay
<1000)usec_delay
=1000;
44 Sleep( usec_delay
/1000);