File: xbt_os_time.h

package info (click to toggle)
simgrid 4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 39,236 kB
  • sloc: cpp: 124,918; ansic: 66,744; python: 8,560; java: 6,773; fortran: 6,079; f90: 5,123; xml: 4,587; sh: 2,194; perl: 1,436; makefile: 111; lisp: 49; javascript: 7; sed: 6
file content (45 lines) | stat: -rw-r--r-- 1,584 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*  xbt/xbt_os_timer.h -- system dependency on time functions               */

/* Copyright (c) 2007-2025. The SimGrid Team. All rights reserved.          */

/* This program is free software; you can redistribute it and/or modify it
 * under the terms of the license (GNU LGPL) which comes with this package. */

#ifndef XBT_OS_TIMER_H
#define XBT_OS_TIMER_H

#include <xbt/misc.h>           /* XBT_PUBLIC */
#include <stddef.h>             /* size_t */

SG_BEGIN_DECL

/** @brief get time in seconds
 *
 * gives  the  number  of  seconds since the Epoch (00:00:00 UTC, January 1, 1970).
 */
XBT_PUBLIC double xbt_os_time(void);
XBT_PUBLIC void xbt_os_sleep(double sec);

typedef struct s_xbt_os_timer *xbt_os_timer_t;
typedef const struct s_xbt_os_timer* const_xbt_os_timer_t;

XBT_PUBLIC xbt_os_timer_t xbt_os_timer_new(void);
XBT_PUBLIC void xbt_os_timer_free(xbt_os_timer_t timer);
XBT_PUBLIC double xbt_os_timer_elapsed(const_xbt_os_timer_t timer);
XBT_PUBLIC size_t xbt_os_timer_size(void);

XBT_PUBLIC void xbt_os_walltimer_start(xbt_os_timer_t timer);
XBT_PUBLIC void xbt_os_walltimer_resume(xbt_os_timer_t timer);
XBT_PUBLIC void xbt_os_walltimer_stop(xbt_os_timer_t timer);

XBT_PUBLIC void xbt_os_cputimer_start(xbt_os_timer_t timer);
XBT_PUBLIC void xbt_os_cputimer_resume(xbt_os_timer_t timer);
XBT_PUBLIC void xbt_os_cputimer_stop(xbt_os_timer_t timer);

XBT_PUBLIC void xbt_os_threadtimer_start(xbt_os_timer_t timer);
XBT_PUBLIC void xbt_os_threadtimer_resume(xbt_os_timer_t timer);
XBT_PUBLIC void xbt_os_threadtimer_stop(xbt_os_timer_t timer);

SG_END_DECL

#endif