ARGOBOTS  66b1c39742507d8df30e8d28c54839b961a14814
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
abti_timer.h
Go to the documentation of this file.
1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 /*
3  * See COPYRIGHT in top-level directory.
4  */
5 
6 #ifndef ABTI_TIMER_H_INCLUDED
7 #define ABTI_TIMER_H_INCLUDED
8 
9 /* Inlined functions for Timer */
10 
11 static inline double ABTI_get_wtime(void)
12 {
13  ABTD_time t;
14  ABTD_time_get(&t);
15  return ABTD_time_read_sec(&t);
16 }
17 
18 static inline ABTI_timer *ABTI_timer_get_ptr(ABT_timer timer)
19 {
20 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
21  ABTI_timer *p_timer;
22  if (timer == ABT_TIMER_NULL) {
23  p_timer = NULL;
24  } else {
25  p_timer = (ABTI_timer *)timer;
26  }
27  return p_timer;
28 #else
29  return (ABTI_timer *)timer;
30 #endif
31 }
32 
33 static inline ABT_timer ABTI_timer_get_handle(ABTI_timer *p_timer)
34 {
35 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
36  ABT_timer h_timer;
37  if (p_timer == NULL) {
38  h_timer = ABT_TIMER_NULL;
39  } else {
40  h_timer = (ABT_timer)p_timer;
41  }
42  return h_timer;
43 #else
44  return (ABT_timer)p_timer;
45 #endif
46 }
47 
48 #endif /* ABTI_TIMER_H_INCLUDED */
#define ABT_TIMER_NULL
Definition: abt.h:426
struct ABT_timer_opaque * ABT_timer
Definition: abt.h:371