@ -27,6 +27,8 @@
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
/* Include the generated header with the model access handles */
@ -41,3 +41,19 @@ Hal_getTimeInMs()
return (now / 10000LL) - DIFF_TO_UNIXTIME;
}
nsSinceEpoch
Hal_getTimeInNs()
{
FILETIME ft;
static const uint64_t DIFF_TO_UNIXTIME = 11644473600000000000LL;
GetSystemTimeAsFileTime(&ft);
nsSinceEpoch nsTime = (LONGLONG)ft.dwLowDateTime + ((LONGLONG)(ft.dwHighDateTime) << 32LL);
nsTime = nsTime * 100LL - DIFF_TO_UNIXTIME;
return nsTime;