4 * Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/)
5 * This file is part of DevLib - See devlib/README for information.
8 * \brief Portable abstraction for high-resolution time handling (implementation)
11 * \author Bernardo Innocenti <bernie@develer.com>
16 * Revision 1.2 2004/06/03 11:27:09 bernie
17 * Add dual-license information.
19 * Revision 1.1 2004/06/03 09:01:06 bernie
30 hptime_t hptime_get(void)
35 * La precisione dei FileTime sarebbe 100ns, ma il
36 * valore viene ottenuto convertendo una struttura
37 * SYSTEMTIME, che ha precisione di 1ms. Il numero
38 * che otteniamo e' quindi sempre un multiplo di
41 GetSystemTimeAsFileTime(&ft);
43 /* Copy the upper/lower into a quadword. */
44 return (((hptime_t)ft.dwHighDateTime) << 32) + (hptime_t)ft.dwLowDateTime;
47 #elif defined(__unix__)
51 hptime_t hptime_get(void)
56 return (hptime_t)tv.tv_sec * HPTIME_TICKS_PER_SECOND
57 + (hptime_t)tv.tv_usec;
61 #error OS dependent support code missing for this OS
62 #endif /* !__unix__ */