4 * Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
5 * This file is part of DevLib - See README.devlib for information.
8 * \brief Portable abstraction for high-resolution time handling (implementation)
11 * \author Bernardo Innocenti <bernie@develer.com>
19 hptime_t hptime_get(void)
24 * La precisione dei FileTime sarebbe 100ns, ma il
25 * valore viene ottenuto convertendo una struttura
26 * SYSTEMTIME, che ha precisione di 1ms. Il numero
27 * che otteniamo e' quindi sempre un multiplo di
30 GetSystemTimeAsFileTime(&ft);
32 /* Copy the upper/lower into a quadword. */
33 return (((hptime_t)ft.dwHighDateTime) << 32) + (hptime_t)ft.dwLowDateTime;
36 #elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
40 hptime_t hptime_get(void)
45 return (hptime_t)tv.tv_sec * HPTIME_TICKS_PER_SECOND
46 + (hptime_t)tv.tv_usec;
50 #error OS dependent support code missing for this OS
51 #endif /* !__unix__ */