mirror of
https://github.com/janbodnar/Windows-API-examples.git
synced 2026-08-06 18:04:46 -04:00
Create windows_epoch.c
This commit is contained in:
parent
1d6cf6ebc4
commit
9b8e6c4d17
21
datetime/windows_epoch.c
Normal file
21
datetime/windows_epoch.c
Normal file
@ -0,0 +1,21 @@
|
||||
#include <windows.h>
|
||||
#include <wchar.h>
|
||||
|
||||
int wmain(void) {
|
||||
|
||||
FILETIME ft = {0};
|
||||
|
||||
GetSystemTimeAsFileTime(&ft);
|
||||
|
||||
LARGE_INTEGER li = {0};
|
||||
|
||||
li.LowPart = ft.dwLowDateTime;
|
||||
li.HighPart = ft.dwHighDateTime;
|
||||
|
||||
long long int hns = li.QuadPart;
|
||||
|
||||
wprintf(L"%lli hundreds of nanoseconds have elapsed "
|
||||
"since Windows API epoch\n", hns);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user