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.4 2004/08/25 14:12:09 rasky
17 *#* Aggiornato il comment block dei log RCS
19 *#* Revision 1.3 2004/08/10 05:45:04 bernie
20 *#* Fix spacing in header.
22 *#* Revision 1.2 2004/06/03 11:27:09 bernie
23 *#* Add dual-license information.
25 *#* Revision 1.1 2004/06/03 09:01:06 bernie
26 *#* Import into DevLib.
36 hptime_t hptime_get(void)
41 * La precisione dei FileTime sarebbe 100ns, ma il
42 * valore viene ottenuto convertendo una struttura
43 * SYSTEMTIME, che ha precisione di 1ms. Il numero
44 * che otteniamo e' quindi sempre un multiplo di
47 GetSystemTimeAsFileTime(&ft);
49 /* Copy the upper/lower into a quadword. */
50 return (((hptime_t)ft.dwHighDateTime) << 32) + (hptime_t)ft.dwLowDateTime;
53 #elif defined(__unix__)
57 hptime_t hptime_get(void)
62 return (hptime_t)tv.tv_sec * HPTIME_TICKS_PER_SECOND
63 + (hptime_t)tv.tv_usec;
67 #error OS dependent support code missing for this OS
68 #endif /* !__unix__ */