OpenMPI  0.1.1
timer.h
1 /*
2  * Copyright (c) 2008 The University of Tennessee and The University
3  * of Tennessee Research Foundation. All rights
4  * reserved.
5  * $COPYRIGHT$
6  *
7  * Additional copyrights may follow
8  *
9  * $HEADER$
10  */
11 
12 #ifndef OMPI_SYS_ARCH_TIMER_H
13 #define OMPI_SYS_ARCH_TIMER_H 1
14 
15 #include <sys/times.h>
16 
17 typedef uint64_t opal_timer_t;
18 
19 static inline opal_timer_t
20 opal_sys_timer_get_cycles(void)
21 {
22  opal_timer_t ret;
23  struct tms accurate_clock;
24 
25  times(&accurate_clock);
26  ret = accurate_clock.tms_utime + accurate_clock.tms_stime;
27 
28  return ret;
29 }
30 
31 #define OPAL_HAVE_SYS_TIMER_GET_CYCLES 1
32 
33 #endif /* ! OMPI_SYS_ARCH_TIMER_H */