mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #1818 from unak/patch-1
fixed broken gettimeofday implementation for Windows
This commit is contained in:
@@ -64,7 +64,7 @@ gettimeofday(struct timeval *tv, void *tz)
|
||||
GetSystemTimeAsFileTime(&t.ft); /* 100 ns intervals since Windows epoch */
|
||||
t.u64 -= 116444736000000000ui64; /* Unix epoch bias */
|
||||
t.u64 /= 10; /* to microseconds */
|
||||
tv->tv_sec = (time_t)(t.u64 / 1000 * 1000);
|
||||
tv->tv_sec = (time_t)(t.u64 / (1000 * 1000));
|
||||
tv->tv_usec = t.u64 % 1000 * 1000;
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user