A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
system-wall-clock-timestamp.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2020 Lawrence Livermore National Laboratory
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Peter D. Barnes, Jr. <pdbarnes@llnl.gov>
19
*/
20
21
#ifndef SYSTEM_WALL_CLOCK_TIMESTAMP_H
22
#define SYSTEM_WALL_CLOCK_TIMESTAMP_H
23
30
#include <string>
31
#include <ctime>
// ctime, time_t
32
33
34
namespace
ns3
{
35
39
class
SystemWallClockTimestamp
40
{
41
public
:
43
SystemWallClockTimestamp
(
void
);
44
46
void
Stamp
(
void
);
47
52
std::string
ToString
(
void
)
const
;
53
58
std::time_t
GetLast
(
void
)
const
;
59
64
std::time_t
GetInterval
(
void
)
const
;
65
66
private
:
67
69
std::time_t
m_last
;
70
72
std::time_t
m_diff
;
73
74
};
// class SystemWallClockTimestamp
75
76
}
// namespace ns3
77
78
#endif
/* SYSTEM_WALL_CLOCK_TIMESTAMP_H */
ns3::SystemWallClockTimestamp
Utility class to record the difference between two wall-clock times.
Definition:
system-wall-clock-timestamp.h:40
ns3::SystemWallClockTimestamp::SystemWallClockTimestamp
SystemWallClockTimestamp(void)
Constructor.
Definition:
system-wall-clock-timestamp.cc:31
ns3::SystemWallClockTimestamp::ToString
std::string ToString(void) const
Get the last time stamp as a string.
Definition:
system-wall-clock-timestamp.cc:47
ns3::SystemWallClockTimestamp::m_diff
std::time_t m_diff
Difference between the two previous time stamps.
Definition:
system-wall-clock-timestamp.h:72
ns3::SystemWallClockTimestamp::GetInterval
std::time_t GetInterval(void) const
Get the last recorded interval.
Definition:
system-wall-clock-timestamp.cc:61
ns3::SystemWallClockTimestamp::m_last
std::time_t m_last
The last time stamp.
Definition:
system-wall-clock-timestamp.h:69
ns3::SystemWallClockTimestamp::GetLast
std::time_t GetLast(void) const
Get the last recorded raw value.
Definition:
system-wall-clock-timestamp.cc:55
ns3::SystemWallClockTimestamp::Stamp
void Stamp(void)
Record the current wall-clock time and delta since the last stamp().
Definition:
system-wall-clock-timestamp.cc:39
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
core
model
system-wall-clock-timestamp.h
Generated on Tue Feb 6 2024 19:21:17 for ns-3 by
1.9.1