Logo AND Algorithmique Numérique Distribuée

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