mirror of
https://github.com/mpv-player/mpv
synced 2025-02-02 05:01:56 +00:00
timer: use gettimeofday() on Windows
MinGW-w64 emulates this via GetSystemTimeAsFileTime(), which has supposedly the best and most stable timer source out of most others. http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/trunk/mingw-w64-crt/misc/gettimeofday.c
This commit is contained in:
parent
81439c5f35
commit
561aab2d77
@ -19,6 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <sys/time.h>
|
||||||
#include <mmsystem.h>
|
#include <mmsystem.h>
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
|
||||||
@ -36,7 +37,9 @@ void mp_sleep_us(int64_t us)
|
|||||||
|
|
||||||
uint64_t mp_raw_time_us(void)
|
uint64_t mp_raw_time_us(void)
|
||||||
{
|
{
|
||||||
return timeGetTime() * 1000;
|
struct timeval tv;
|
||||||
|
gettimeofday(&tv,NULL);
|
||||||
|
return tv.tv_sec * 1000000LL + tv.tv_usec;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mp_raw_time_init(void)
|
void mp_raw_time_init(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user