Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
typo--
[simgrid.git] / include / xbt / xbt_os_time.h
1 /*  xbt/xbt_os_timer.h -- system dependency on time functions               */
2
3 /* Copyright (c) 2007, 2009-2010, 2012-2014. The SimGrid Team.
4  * All rights reserved.                                                     */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9 #ifndef _XBT_OS_TIMER_H
10 #define _XBT_OS_TIMER_H
11
12 #include <xbt/misc.h>           /* XBT_PUBLIC */
13 #include <stddef.h>             /* size_t */
14
15 SG_BEGIN_DECL()
16
17 /** @brief get time in seconds 
18  *
19  * gives  the  number  of  seconds since the Epoch (00:00:00 UTC, January 1, 1970).
20  */
21 XBT_PUBLIC(double) xbt_os_time(void);
22 XBT_PUBLIC(void) xbt_os_sleep(double sec);
23
24 typedef struct s_xbt_os_timer *xbt_os_timer_t;
25
26 XBT_PUBLIC(xbt_os_timer_t) xbt_os_timer_new(void);
27 XBT_PUBLIC(void) xbt_os_timer_free(xbt_os_timer_t timer);
28 XBT_PUBLIC(double) xbt_os_timer_elapsed(xbt_os_timer_t timer);
29 XBT_PUBLIC(size_t) xbt_os_timer_size(void);
30
31 XBT_PUBLIC(void) xbt_os_walltimer_start(xbt_os_timer_t timer);
32 XBT_PUBLIC(void) xbt_os_walltimer_resume(xbt_os_timer_t timer);
33 XBT_PUBLIC(void) xbt_os_walltimer_stop(xbt_os_timer_t timer);
34
35 XBT_PUBLIC(void) xbt_os_cputimer_start(xbt_os_timer_t timer);
36 XBT_PUBLIC(void) xbt_os_cputimer_resume(xbt_os_timer_t timer);
37 XBT_PUBLIC(void) xbt_os_cputimer_stop(xbt_os_timer_t timer);
38
39 XBT_PUBLIC(void) xbt_os_threadtimer_start(xbt_os_timer_t timer);
40 XBT_PUBLIC(void) xbt_os_threadtimer_resume(xbt_os_timer_t timer);
41 XBT_PUBLIC(void) xbt_os_threadtimer_stop(xbt_os_timer_t timer);
42
43 SG_END_DECL()
44
45 #endif