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>
20 hptime_t hptime_get(void)
25 * La precisione dei FileTime sarebbe 100ns, ma il
26 * valore viene ottenuto convertendo una struttura
27 * SYSTEMTIME, che ha precisione di 1ms. Il numero
28 * che otteniamo e' quindi sempre un multiplo di
31 GetSystemTimeAsFileTime(&ft);
33 /* Copy the upper/lower into a quadword. */
34 return (((hptime_t)ft.dwHighDateTime) << 32) + (hptime_t)ft.dwLowDateTime;
37 #elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
41 hptime_t hptime_get(void)
46 return (hptime_t)tv.tv_sec * HPTIME_TICKS_PER_SECOND
47 + (hptime_t)tv.tv_usec;
51 #error OS dependent support code missing for this OS
52 #endif /* !__unix__ */