OpenMPI  0.1.1
timer_solaris.h
1 /*
2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3  * University Research and Technology
4  * Corporation. All rights reserved.
5  * Copyright (c) 2004-2005 The University of Tennessee and The University
6  * of Tennessee Research Foundation. All rights
7  * reserved.
8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9  * University of Stuttgart. All rights reserved.
10  * Copyright (c) 2004-2005 The Regents of the University of California.
11  * All rights reserved.
12  * $COPYRIGHT$
13  *
14  * Additional copyrights may follow
15  *
16  * $HEADER$
17  */
18 
19 #ifndef OPAL_MCA_TIMER_SOLARIS_TIMER_SOLARIS_H
20 #define OPAL_MCA_TIMER_SOLARIS_TIMER_SOLARIS_H
21 
22 #include <sys/time.h>
23 
24 typedef hrtime_t opal_timer_t;
25 
26 
27 static inline opal_timer_t
28 opal_timer_base_get_cycles(void)
29 {
30  return 0;
31 }
32 
33 static inline opal_timer_t
34 opal_timer_base_get_usec(void)
35 {
36  /* gethrtime returns nanoseconds */
37  return gethrtime() / 1000;
38 }
39 
40 static inline opal_timer_t
41 opal_timer_base_get_freq(void)
42 {
43  return 0;
44 }
45 
46 
47 #define OPAL_TIMER_CYCLE_NATIVE 0
48 #define OPAL_TIMER_CYCLE_SUPPORTED 0
49 #define OPAL_TIMER_USEC_NATIVE 1
50 #define OPAL_TIMER_USEC_SUPPORTED 1
51 
52 #endif