Logo AND Algorithmique Numérique Distribuée

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