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.3 2004/08/10 05:45:04 bernie
17 * Fix spacing in header.
19 * Revision 1.2 2004/06/03 11:27:09 bernie
20 * Add dual-license information.
22 * Revision 1.1 2004/06/03 09:01:06 bernie
33 hptime_t hptime_get(void)
38 * La precisione dei FileTime sarebbe 100ns, ma il
39 * valore viene ottenuto convertendo una struttura
40 * SYSTEMTIME, che ha precisione di 1ms. Il numero
41 * che otteniamo e' quindi sempre un multiplo di
44 GetSystemTimeAsFileTime(&ft);
46 /* Copy the upper/lower into a quadword. */
47 return (((hptime_t)ft.dwHighDateTime) << 32) + (hptime_t)ft.dwLowDateTime;
50 #elif defined(__unix__)
54 hptime_t hptime_get(void)
59 return (hptime_t)tv.tv_sec * HPTIME_TICKS_PER_SECOND
60 + (hptime_t)tv.tv_usec;
64 #error OS dependent support code missing for this OS
65 #endif /* !__unix__ */