1 |
/// @file sysclk.h |
2 |
/// @author Kimball Thurston |
3 |
/// |
4 |
|
5 |
// |
6 |
// Copyright (c) 2004 Kimball Thurston |
7 |
// |
8 |
// This program is free software; you can redistribute it and/or modify |
9 |
// it under the terms of the GNU General Public License version 2 as |
10 |
// published by the Free Software Foundation. |
11 |
// |
12 |
// This program is distributed in the hope that it will be useful, |
13 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
// GNU General Public License for more details. |
16 |
// |
17 |
// You should have received a copy of the GNU General Public License |
18 |
// along with this program; if not, write to the Free Software |
19 |
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 |
// |
21 |
|
22 |
#ifndef _SYSCLK_H_ |
23 |
#define _SYSCLK_H_ |
24 |
|
25 |
#include "types.h" |
26 |
/** |
27 |
* Retrieves the host global high-resolution ticks. This is expected to be a |
28 |
* counter that is very fast to query, and has very good resolution. |
29 |
* |
30 |
* On x86 architecture, this is probably best implemented as retrieving the time |
31 |
* stamp counter (rdtsc).*/ |
32 |
uint64 sys_get_hiresclk_ticks(); |
33 |
|
34 |
/* |
35 |
* Find the number of high resolution ticks per second. |
36 |
*/ |
37 |
uint64 sys_get_hiresclk_ticks_per_second(); |
38 |
|
39 |
#endif /* _SYSCLK_H_ */ |