A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
system-wall-clock-ms.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage.inria.fr>
7 */
8
9#ifndef SYSTEM_WALL_CLOCK_MS_H
10#define SYSTEM_WALL_CLOCK_MS_H
11
12#include <stdint.h>
13
14/**
15 * \file
16 * \ingroup system
17 * ns3::SystemWallClockMs declaration.
18 */
19
20namespace ns3
21{
22
23/**
24 * \ingroup system
25 * \brief Measure elapsed wall clock time in milliseconds.
26 */
28{
29 public:
32
33 /**
34 * Start a measure.
35 */
36 void Start();
37 /**
38 * \brief Stop measuring the time since Start() was called.
39 * \returns the measured elapsed wall clock time (in milliseconds) since
40 * Start() was invoked.
41 *
42 * It is possible to start a new measurement with Start() after
43 * this method returns.
44 *
45 * Returns \c int64_t to avoid dependency on \c clock_t in ns-3 code.
46 */
47 int64_t End();
48
49 /**
50 * \returns the measured elapsed wall clock time (in milliseconds) since
51 * Start() was invoked.
52 *
53 * Returns \c int64_t to avoid dependency on \c clock_t in ns-3 code.
54 */
55 int64_t GetElapsedReal() const;
56 /**
57 * \returns the measured elapsed 'user' wall clock time (in milliseconds)
58 * since Start() was invoked.
59 *
60 * Returns \c int64_t to avoid dependency on \c clock_t in ns-3 code.
61 */
62 int64_t GetElapsedUser() const;
63 /**
64 * \returns the measured elapsed 'system' wall clock time (in milliseconds)
65 * since Start() was invoked.
66 *
67 * Returns \c int64_t to avoid dependency on \c clock_t in ns-3 code.
68 */
69 int64_t GetElapsedSystem() const;
70
71 private:
72 class SystemWallClockMsPrivate* m_priv; //!< The implementation.
73};
74
75} // namespace ns3
76
77#endif /* SYSTEM_WALL_CLOCK_MS_H */
Measure elapsed wall clock time in milliseconds.
class SystemWallClockMsPrivate * m_priv
The implementation.
int64_t End()
Stop measuring the time since Start() was called.
void Start()
Start a measure.
System-dependent implementation for SystemWallClockMs.
Every class exported by the ns3 library is enclosed in the ns3 namespace.