Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

Commit

Permalink
Fixed implementation of gettimeofday for Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgaleano authored and Andy Green committed Jan 10, 2013
1 parent 40e79ad commit 18f9f99
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion win32port/win32helpers/gettimeofday.c
Expand Up @@ -26,9 +26,11 @@ int gettimeofday(struct timeval *tv, struct timezone *tz)
tmpres <<= 32;
tmpres |= ft.dwLowDateTime;

/*convert into microseconds*/
tmpres /= 10;

/*converting file time to unix epoch*/
tmpres -= DELTA_EPOCH_IN_MICROSECS;
tmpres /= 10; /*convert into microseconds*/
tv->tv_sec = (long)(tmpres / 1000000UL);
tv->tv_usec = (long)(tmpres % 1000000UL);
}
Expand Down

0 comments on commit 18f9f99

Please sign in to comment.