Simulation virtual time values and global simulation resolution. More...
#include "nstime.h"
Classes | |
struct | Information |
How to convert between other units and the current unit. More... | |
struct | Resolution |
Current time unit, and conversion info. More... | |
Public Types | |
typedef void(* | TracedCallback) (Time value) |
TracedCallback signature for Time. More... | |
enum | Unit { Y = 0 , D = 1 , H = 2 , MIN = 3 , S = 4 , MS = 5 , US = 6 , NS = 7 , PS = 8 , FS = 9 , LAST = 10 , AUTO = 11 } |
The unit to use to interpret a number representing time. More... | |
Public Member Functions | |
Time () | |
Default constructor, with value 0. More... | |
Time (const std::string &s) | |
Construct Time object from common time expressions like "1ms". More... | |
Time (const Time &o) | |
Copy constructor. More... | |
Time (Time &&o) | |
Move constructor. More... | |
~Time () | |
Destructor. More... | |
TimeWithUnit | As (const enum Unit unit=Time::AUTO) const |
Attach a unit to a Time, to facilitate output in a specific unit. More... | |
int | Compare (const Time &o) const |
Compare this to another Time. More... | |
bool | IsNegative (void) const |
Exactly equivalent to t <= 0 . More... | |
bool | IsPositive (void) const |
Exactly equivalent to t >= 0 . More... | |
bool | IsStrictlyNegative (void) const |
Exactly equivalent to t < 0 . More... | |
bool | IsStrictlyPositive (void) const |
Exactly equivalent to t > 0 . More... | |
bool | IsZero (void) const |
Exactly equivalent to t == 0 . More... | |
Time & | operator= (const Time &o) |
Assignment operator. More... | |
Time | RoundTo (enum Unit unit) const |
Round a Time to a specific unit. More... | |
Numeric constructors | |
Construct from a numeric value. | |
Time (double v) | |
Construct from a numeric value. More... | |
Time (int v) | |
Construct from a numeric value. More... | |
Time (long int v) | |
Construct from a numeric value. More... | |
Time (long long int v) | |
Construct from a numeric value. More... | |
Time (unsigned int v) | |
Construct from a numeric value. More... | |
Time (unsigned long int v) | |
Construct from a numeric value. More... | |
Time (unsigned long long int v) | |
Construct from a numeric value. More... | |
Time (const int64x64_t &v) | |
Construct from a numeric value. More... | |
Convert to Number in a Unit | |
Convert a Time to number, in indicated units. Conversions to seconds and larger will return doubles, with possible loss of precision. Conversions to units smaller than seconds will be rounded. | |
double | GetYears (void) const |
Get an approximation of the time stored in this instance in the indicated unit. More... | |
double | GetDays (void) const |
Get an approximation of the time stored in this instance in the indicated unit. More... | |
double | GetHours (void) const |
Get an approximation of the time stored in this instance in the indicated unit. More... | |
double | GetMinutes (void) const |
Get an approximation of the time stored in this instance in the indicated unit. More... | |
double | GetSeconds (void) const |
Get an approximation of the time stored in this instance in the indicated unit. More... | |
int64_t | GetMilliSeconds (void) const |
Get an approximation of the time stored in this instance in the indicated unit. More... | |
int64_t | GetMicroSeconds (void) const |
Get an approximation of the time stored in this instance in the indicated unit. More... | |
int64_t | GetNanoSeconds (void) const |
Get an approximation of the time stored in this instance in the indicated unit. More... | |
int64_t | GetPicoSeconds (void) const |
Get an approximation of the time stored in this instance in the indicated unit. More... | |
int64_t | GetFemtoSeconds (void) const |
Get an approximation of the time stored in this instance in the indicated unit. More... | |
Convert to Raw Value | |
Convert a Time to a number in the current resolution units. | |
int64_t | GetTimeStep (void) const |
Get the raw time value, in the current resolution unit. More... | |
double | GetDouble (void) const |
Get the raw time value, in the current resolution unit. More... | |
int64_t | GetInteger (void) const |
Get the raw time value, in the current resolution unit. More... | |
Get Times as Numbers in Specified Units | |
Get the Time as integers or doubles in the indicated unit. | |
int64_t | ToInteger (enum Unit unit) const |
Get the Time value expressed in a particular unit. More... | |
double | ToDouble (enum Unit unit) const |
Get the Time value expressed in a particular unit. More... | |
int64x64_t | To (enum Unit unit) const |
Get the Time value expressed in a particular unit. More... | |
Static Public Member Functions | |
static Time | From (const int64x64_t &value) |
Create a Time in the current unit. More... | |
static enum Unit | GetResolution (void) |
static Time | Max () |
Maximum representable Time Not to be confused with Max(Time,Time). More... | |
static Time | Min () |
Minimum representable Time Not to be confused with Min(Time,Time). More... | |
static void | SetResolution (enum Unit resolution) |
static bool | StaticInit () |
Function to force static initialization of Time. More... | |
Create Times from Values and Units | |
Create Times from values given in the indicated units. | |
static Time | FromInteger (uint64_t value, enum Unit unit) |
Create a Time equal to value in unit unit . More... | |
static Time | FromDouble (double value, enum Unit unit) |
Create a Time equal to value in unit unit . More... | |
static Time | From (const int64x64_t &value, enum Unit unit) |
Create a Time equal to value in unit unit . More... | |
Private Types | |
typedef std::set< Time * > | MarkedTimes |
Record all instances of Time, so we can rescale them when the resolution changes. More... | |
Static Private Member Functions | |
static void | Clear (Time *const time) |
Remove a Time instance from the MarkedTimes, called by ~Time(). More... | |
static void | ClearMarkedTimes () |
Remove all MarkedTimes. More... | |
static void | ConvertTimes (const enum Unit unit) |
Convert existing Times to the new unit. More... | |
static void | Mark (Time *const time) |
Record a Time instance with the MarkedTimes. More... | |
static struct Information * | PeekInformation (enum Unit timeUnit) |
Get the Information record for timeUnit for the current Resolution. More... | |
static struct Resolution * | PeekResolution (void) |
Get the current Resolution. More... | |
static struct Resolution | SetDefaultNsResolution (void) |
Set the default resolution. More... | |
static void | SetResolution (enum Unit unit, struct Resolution *resolution, const bool convert=true) |
Set the current Resolution. More... | |
Private Attributes | |
int64_t | m_data |
Virtual time value, in the current unit. More... | |
Static Private Attributes | |
static MarkedTimes * | g_markingTimes = 0 |
Record of outstanding Time objects which will need conversion when the resolution is set. More... | |
Friends | |
template<class T > | |
std::enable_if< std::is_floating_point< T >::value, Time >::type | operator* (const Time &lhs, T rhs) |
Scale a Time by an integer value. More... | |
template<class T > | |
std::enable_if< std::is_floating_point< T >::value, Time >::type | operator/ (const Time &lhs, T rhs) |
Divide a Time by an integer value. More... | |
Comparison operators | |
bool | operator== (const Time &lhs, const Time &rhs) |
Equality operator for Time. More... | |
bool | operator!= (const Time &lhs, const Time &rhs) |
Inequality operator for Time. More... | |
bool | operator<= (const Time &lhs, const Time &rhs) |
Less than or equal operator for Time. More... | |
bool | operator>= (const Time &lhs, const Time &rhs) |
Greater than or equal operator for Time. More... | |
bool | operator< (const Time &lhs, const Time &rhs) |
Less than operator for Time. More... | |
bool | operator> (const Time &lhs, const Time &rhs) |
Greater than operator for Time. More... | |
bool | operator< (const Time &time, const EventId &event) |
Compare a Time to an EventId. More... | |
Arithmetic operators | |
Time | operator+ (const Time &lhs, const Time &rhs) |
Addition operator for Time. More... | |
Time | operator- (const Time &lhs, const Time &rhs) |
Subtraction operator for Time. More... | |
Time | operator* (const Time &lhs, const int64x64_t &rhs) |
Scale a Time by a numeric value. More... | |
Time | operator* (const int64x64_t &lhs, const Time &rhs) |
Scale a Time by a numeric value. More... | |
int64x64_t | operator/ (const Time &lhs, const Time &rhs) |
Exact division, returning a dimensionless fixed point number. More... | |
Time | operator/ (const Time &lhs, const int64x64_t &rhs) |
Scale a Time by a numeric value. More... | |
Time | operator% (const Time &lhs, const Time &rhs) |
Remainder (modulus) from the quotient of two Times. More... | |
int64_t | Div (const Time &lhs, const Time &rhs) |
Integer quotient from dividing two Times. More... | |
Time | Rem (const Time &lhs, const Time &rhs) |
Addition operator for Time. More... | |
template<class T > | |
std::enable_if< std::is_integral< T >::value, Time >::type | operator* (const Time &lhs, T rhs) |
Scale a Time by an integer value. More... | |
template<class T > | |
std::enable_if< std::is_arithmetic< T >::value, Time >::type | operator* (T lhs, const Time &rhs) |
Scale a Time by a numeric value. More... | |
template<class T > | |
std::enable_if< std::is_integral< T >::value, Time >::type | operator/ (const Time &lhs, T rhs) |
Divide a Time by an integer value. More... | |
Time | Abs (const Time &time) |
Absolute value for Time. More... | |
Time | Max (const Time &timeA, const Time &timeB) |
Maximum of two Times. More... | |
Time | Min (const Time &timeA, const Time &timeB) |
Minimum of two Times. More... | |
Compound assignment operators | |
Time & | operator+= (Time &lhs, const Time &rhs) |
Compound addition assignment for Time. More... | |
Time & | operator-= (Time &lhs, const Time &rhs) |
Compound subtraction assignment for Time. More... | |
Related Functions | |
(Note that these are not member functions.) | |
static bool | g_TimeStaticInit = Time::StaticInit () |
Force static initialization order of Time in each compilation unit. More... | |
Time | TimeStep (uint64_t ts) |
Scheduler interface. More... | |
Simulation virtual time values and global simulation resolution.
This class defines all the classic C++ addition/subtraction operators: +, -, +=, -=; and all the classic comparison operators: ==, !=, <, >, <=, >=. It is thus easy to add, subtract, or compare Time objects.
For example:
You can also use the following non-member functions to manipulate any of these ns3::Time object:
This class also controls the resolution of the underlying time representation. The resolution is the smallest representable time interval. The default resolution is nanoseconds.
To change the resolution, use SetResolution(). All Time objects created before the call to SetResolution() will be updated to the new resolution. This can only be done once! (Tracking each Time object uses 4 pointers. For speed, once we convert the existing instances we discard the recording data structure and stop tracking new instances, so we have no way to do a second conversion.)
If you increase the global resolution, you also implicitly decrease the maximum simulation duration. The global simulation time is stored in a 64 bit integer whose interpretation will depend on the global resolution. Therefore the maximum possible duration of your simulation if you use picoseconds is 2^64 ps = 2^24 s = 7 months, whereas, had you used nanoseconds, you could have run for 584 years.
|
private |
Record all instances of Time, so we can rescale them when the resolution changes.
We use a std::set so we can remove the record easily when ~Time() is called.
We don't use Ptr<Time>, because we would have to bloat every Time instance with SimpleRefCount<Time>.
Seems like this should be std::set< Time * const >, but Stack Overflow says otherwise, quoting the standard:
& sect;23.1/3 states that std::set key types must be assignable and copy constructable; clearly a const type will not be assignable.
typedef void(* ns3::Time::TracedCallback) (Time value) |
TracedCallback signature for Time.
[in] | value | Current value of Time |
enum ns3::Time::Unit |
The unit to use to interpret a number representing time.
Enumerator | |
---|---|
Y | year, 365 days |
D | day, 24 hours |
H | hour, 60 minutes |
MIN | minute, 60 seconds |
S | second |
MS | millisecond |
US | microsecond |
NS | nanosecond |
PS | picosecond |
FS | femtosecond |
LAST | marker for last normal value |
AUTO | auto-scale output when using Time::As() |
|
inline |
Default constructor, with value 0.
Definition at line 135 of file nstime.h.
References g_markingTimes, and Mark().
Referenced by From(), FromInteger(), Max(), and Min().
|
inline |
Copy constructor.
[in] | o | Time to copy |
Definition at line 148 of file nstime.h.
References g_markingTimes, and Mark().
|
inline |
Move constructor.
[in] | o | Time from which take the data |
Definition at line 162 of file nstime.h.
References g_markingTimes, and Mark().
|
inlineexplicit |
Construct from a numeric value.
The current time resolution will be assumed as the unit.
[in] | v | The value. |
Definition at line 180 of file nstime.h.
References g_markingTimes, and Mark().
|
inlineexplicit |
Construct from a numeric value.
The current time resolution will be assumed as the unit.
[in] | v | The value. |
Definition at line 188 of file nstime.h.
References g_markingTimes, and Mark().
|
inlineexplicit |
Construct from a numeric value.
The current time resolution will be assumed as the unit.
[in] | v | The value. |
Definition at line 196 of file nstime.h.
References g_markingTimes, and Mark().
|
inlineexplicit |
Construct from a numeric value.
The current time resolution will be assumed as the unit.
[in] | v | The value. |
Definition at line 204 of file nstime.h.
References g_markingTimes, and Mark().
|
inlineexplicit |
Construct from a numeric value.
The current time resolution will be assumed as the unit.
[in] | v | The value. |
Definition at line 212 of file nstime.h.
References g_markingTimes, and Mark().
|
inlineexplicit |
Construct from a numeric value.
The current time resolution will be assumed as the unit.
[in] | v | The value. |
Definition at line 220 of file nstime.h.
References g_markingTimes, and Mark().
|
inlineexplicit |
Construct from a numeric value.
The current time resolution will be assumed as the unit.
[in] | v | The value. |
Definition at line 228 of file nstime.h.
References g_markingTimes, and Mark().
|
inlineexplicit |
Construct from a numeric value.
The current time resolution will be assumed as the unit.
[in] | v | The value. |
Definition at line 236 of file nstime.h.
References g_markingTimes, and Mark().
|
explicit |
Construct Time object from common time expressions like "1ms".
Supported units include:
s
(seconds)ms
(milliseconds)us
(microseconds)ns
(nanoseconds)ps
(picoseconds)fs
(femtoseconds)min
(minutes)h
(hours)d
(days)y
(years)There can be no white space between the numerical portion and the units. Any otherwise malformed string causes a fatal error to occur.
[in] | s | The string to parse into a Time |
|
inline |
Destructor.
Definition at line 288 of file nstime.h.
References Clear(), and g_markingTimes.
TimeWithUnit ns3::Time::As | ( | const enum Unit | unit = Time::AUTO | ) | const |
Attach a unit to a Time, to facilitate output in a specific unit.
For example,
will print +3140.0ms
[in] | unit | The unit to use. |
Definition at line 418 of file time.cc.
Referenced by ns3::SixLowPanNetDevice::AddContext(), ThreeGppHttpClientServerTestSuite::AddHttpObjectTestCase(), ns3::dsr::DsrRouteCache::AddRoute_Link(), ns3::AsciiLrWpanMacTransmitSinkWithContext(), ns3::AsciiLrWpanMacTransmitSinkWithoutContext(), ns3::InterferenceHelper::CalculatePhyHeaderSectionPsr(), ns3::LrWpanCsmaCa::CanProceed(), TimeInputOutputTestCase::CheckAs(), ns3::FlowMonitor::CheckForLostPackets(), ThreeGppHttpObjectTestCase::ClientRxDelayCallback(), ThreeGppHttpObjectTestCase::ClientRxRttCallback(), ns3::ThreeGppHttpServerTxBuffer::CloseAllSockets(), ns3::ThreeGppHttpServerTxBuffer::CloseSocket(), ns3::CobaltQueueDisc::CobaltShouldDrop(), BatteryLifetimeTest::ConstantLoadTest(), ns3::dsr::DsrRouteCache::DecStability(), ns3::DefaultTimePrinter(), ns3::TbfQueueDisc::DoDequeue(), ns3::A3RsrpHandoverAlgorithm::DoInitialize(), ns3::LteRlcSm::DoReceivePdu(), LteRadioLinkFailureTestCase::DoRun(), TimeInputOutputTestCase::DoRun(), LrWpanSlottedCsmacaTestCase::DoRun(), LteRlcAmE2eTestCase::DoRun(), LteHandoverDelayTestCase::EnbHandoverEndOkCallback(), EnbRrcTimeout(), ns3::PhyEntity::EndOfMpdu(), ns3::UanMacCw::Enqueue(), ns3::ThreeGppHttpClient::EnterParsingTime(), ns3::ThreeGppHttpClient::EnterReadingTime(), ns3::dsr::DsrRouteCache::FindSameRoute(), ns3::dot11s::HwmpProtocol::ForwardPathError(), ns3::LteUePhy::GenerateCqiRsrpRsrq(), ns3::ChannelAccessManager::GetBackoffEndFor(), ns3::ChannelAccessManager::GetBackoffStartFor(), ns3::CommandLineHelper::GetDefault< Time >(), ns3::PhyEntity::GetReceptionStatus(), ns3::dsdv::RoutingProtocol::GetSettlingTime(), ns3::LrWpanCsmaCa::GetTimeToNextSlot(), ns3::ShowProgress::GiveFeedback(), ns3::LrWpanMac::IfsWaitTimeout(), ns3::dsr::DsrRouteCache::IncStability(), ns3::aodv::RoutingTableEntry::Invalidate(), ns3::QosFrameExchangeManager::IsWithinSizeAndTimeLimits(), ns3::olsr::RoutingProtocol::LinkSensing(), OcbWifiMacTestCase::MacAssoc(), ns3::aodv::RoutingTable::MarkLinkAsUnidirectional(), JakesPropagationExample::Next(), NotifyConnectionEstablishedEnb(), NotifyConnectionEstablishedUe(), NotifyConnectionTimeoutUe(), NotifyHandoverEndOkEnb(), NotifyHandoverEndOkUe(), NotifyHandoverStartEnb(), NotifyHandoverStartUe(), NotifyRandomAccessErrorUe(), NotifyRaResponseTimeoutUe(), NotifyViaTraceSource(), ns3::CoDelQueueDisc::OkToDrop(), ns3::operator<<(), ns3::LrWpanMac::PdDataConfirm(), ns3::LrWpanMac::PdDataIndication(), LrWpanCcaTestCase::PhyRxBegin(), LrWpanCcaTestCase::PhyRxDrop(), LrWpanCcaTestCase::PhyRxEnd(), OcbWifiMacTestCase::PhyRxOkTrace(), PhySyncDetection(), LrWpanCcaTestCase::PhyTxBegin(), LrWpanCcaTestCase::PhyTxEnd(), OcbWifiMacTestCase::PhyTxTrace(), LrWpanCcaTestCase::PlmeCcaConfirm(), ns3::dsdv::RoutingTableEntry::Print(), ns3::SeqTsEchoHeader::Print(), ns3::UanHeaderRcData::Print(), ns3::UanHeaderRcRts::Print(), ns3::UanHeaderRcCtsGlobal::Print(), ns3::UanHeaderRcCts::Print(), ns3::TcpTxItem::Print(), PrintCellInfo(), ns3::Ipv6RoutingHelper::PrintNdiscCache(), ns3::Ipv6RoutingHelper::PrintNdiscCacheEvery(), PrintReceivedRoutingPacket(), ns3::NixVectorRouting< T >::PrintRoutingPath(), ns3::aodv::RoutingProtocol::PrintRoutingTable(), ns3::dsdv::RoutingProtocol::PrintRoutingTable(), ns3::Ipv4GlobalRouting::PrintRoutingTable(), ns3::Ipv4ListRouting::PrintRoutingTable(), ns3::Ipv4StaticRouting::PrintRoutingTable(), ns3::Ipv6ListRouting::PrintRoutingTable(), ns3::Ipv6StaticRouting::PrintRoutingTable(), ns3::Rip::PrintRoutingTable(), ns3::RipNg::PrintRoutingTable(), ns3::NixVectorRouting< T >::PrintRoutingTable(), ns3::olsr::RoutingProtocol::PrintRoutingTable(), ns3::UplinkSchedulerMBQoS::ProcessBandwidthRequest(), ns3::LrWpanCsmaCa::RandomBackoffDelay(), WaveNetDeviceExample::Receive(), ns3::V4Ping::Receive(), ns3::V4TraceRoute::Receive(), ns3::ThreeGppHttpServer::ReceivedDataCallback(), ns3::MeshPointDevice::ReceiveFromDevice(), ns3::dot11s::HwmpProtocol::ReceivePrep(), ns3::dot11s::HwmpProtocol::ReceivePreq(), WaveNetDeviceExample::ReceiveVsa(), ns3::ThreeGppHttpServerTxBuffer::RecordNextServe(), ns3::dsdv::RoutingProtocol::RecvDsdv(), ns3::ThreeGppHttpServerTxBuffer::RemoveSocket(), ns3::SixLowPanNetDevice::RenewContext(), ns3::WifiTxTimer::Reschedule(), ns3::FrameExchangeManager::RxStartIndication(), ns3::UanMacRc::ScheduleData(), ns3::PhyEntity::ScheduleEndOfMpdus(), ns3::OnOffApplication::ScheduleNextTx(), ns3::aodv::RoutingProtocol::ScheduleRreqRetry(), ns3::dsr::DsrRouting::ScheduleRreqRetry(), ns3::OnOffApplication::ScheduleStartEvent(), ns3::OnOffApplication::ScheduleStopEvent(), ns3::WifiPhy::Send(), ns3::aodv::RoutingProtocol::SendRerrMessage(), ns3::aodv::RoutingProtocol::SendRerrWhenNoRouteToForward(), ns3::ThreeGppHttpHeader::SetClientTs(), ns3::ThreeGppHttpVariables::SetEmbeddedObjectGenerationDelay(), ns3::PointToPointNetDevice::SetInterframeGap(), ns3::ThreeGppHttpVariables::SetMainObjectGenerationDelay(), ns3::ThreeGppHttpVariables::SetParsingTimeMean(), ns3::ThreeGppHttpVariables::SetReadingTimeMean(), ns3::ThreeGppHttpHeader::SetServerTs(), ns3::HePhy::SetTrigVector(), ns3::TimeProbe::SetValue(), ns3::TimeProbe::SetValueByPath(), ns3::dsr::DsrRouting::Start(), ns3::FlowMonitor::Start(), ns3::UanMacRcGw::StartCycle(), ns3::BaseStationNetDevice::StartDlSubFrame(), ns3::LrWpanMac::StartInactivePeriod(), ns3::QosTxop::StartMuEdcaTimerNow(), ns3::SpectrumWifiPhy::StartRx(), ns3::UanMacCw::StartTimer(), ns3::WaveFrameExchangeManager::StartTransmission(), ns3::BaseStationNetDevice::StartUlSubFrame(), StateChangeNotification(), ns3::FlowMonitor::Stop(), ns3::WifiPhy::SwitchMaybeToCcaBusy(), Throughput(), ns3::TimeProbe::TraceSink(), ns3::CsmaNetDevice::TransmitCompleteEvent(), ns3::CsmaChannel::TransmitEnd(), ns3::CsmaNetDevice::TransmitStart(), ns3::PointToPointNetDevice::TransmitStart(), ns3::RrMultiUserScheduler::TrySendingBasicTf(), ns3::RrMultiUserScheduler::TrySendingBsrpTf(), LteHandoverDelayTestCase::UeHandoverEndOkCallback(), UeStateTransition(), and BatteryLifetimeTest::VariableLoadTest().
|
staticprivate |
Remove a Time instance from the MarkedTimes, called by ~Time().
[in] | time | The Time instance to remove. |
Definition at line 343 of file time.cc.
References ns3::g_markingMutex, g_markingTimes, NS_ASSERT, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, and NS_LOG_WARN.
Referenced by ~Time().
|
staticprivate |
Remove all MarkedTimes.
We're called by Simulator::Run, which knows nothing about the mutex, so we need a critical section here.
It would seem natural to use this function at the end of ConvertTimes, but that function already has the mutex. The mutex can not be locked more than once in the same thread, so calling this function from ConvertTimes is a bad idea.
Instead, we copy this body into ConvertTimes.
Definition at line 287 of file time.cc.
References ns3::g_markingMutex, g_markingTimes, NS_LOG_FUNCTION_NOARGS, and NS_LOG_LOGIC.
Referenced by ns3::Simulator::Run().
|
inline |
|
staticprivate |
Convert existing Times to the new unit.
[in] | unit | The Unit to convert existing Times to. |
Definition at line 373 of file time.cc.
References ns3::g_markingMutex, g_markingTimes, m_data, max, min, NS_ASSERT_MSG, NS_LOG_FUNCTION_NOARGS, NS_LOG_LOGIC, and ToInteger().
Referenced by SetResolution().
|
inlinestatic |
Create a Time in the current unit.
[in] | value | The value of the new Time. |
Definition at line 450 of file nstime.h.
References Time().
Referenced by ns3::Days(), ns3::FemtoSeconds(), FromDouble(), ns3::Hours(), ns3::RttMeanDeviation::IntegerUpdate(), ns3::MicroSeconds(), ns3::MilliSeconds(), ns3::Minutes(), ns3::NanoSeconds(), ns3::PicoSeconds(), RoundTo(), ns3::Seconds(), and ns3::Years().
|
inlinestatic |
Create a Time equal to value in unit unit
.
[in] | value | The new Time value, expressed in unit |
[in] | unit | The unit of value |
unit
Definition at line 484 of file nstime.h.
References Time(), ns3::Time::Information::fromMul, ns3::int64x64_t::MulByInvert(), PeekInformation(), and ns3::Time::Information::timeFrom.
Create a Time equal to value in unit unit
.
[in] | value | The new Time value, expressed in unit |
[in] | unit | The unit of value |
unit
Definition at line 480 of file nstime.h.
References From().
Referenced by ns3::Days(), ns3::RttMeanDeviation::FloatingPointUpdate(), ns3::Hours(), ns3::Minutes(), ns3::TcpSocketBase::ReTxTimeout(), ns3::Seconds(), SetDefaultNsResolution(), and ns3::Years().
Create a Time equal to value in unit unit
.
[in] | value | The new Time value, expressed in unit |
[in] | unit | The unit of value |
unit
Definition at line 467 of file nstime.h.
References Time(), ns3::Time::Information::factor, ns3::Time::Information::fromMul, and PeekInformation().
Referenced by ns3::FemtoSeconds(), ns3::MicroSeconds(), ns3::MilliSeconds(), ns3::NanoSeconds(), and ns3::PicoSeconds().
|
inline |
Get an approximation of the time stored in this instance in the indicated unit.
Definition at line 367 of file nstime.h.
References D, and ToDouble().
|
inline |
Get the raw time value, in the current resolution unit.
Definition at line 419 of file nstime.h.
References m_data.
Referenced by ns3::BsmApplication::StartApplication(), TimeSimpleTestCase::TestMultiplicationByDecimalTypes(), and ns3::TcpHtcp::UpdateBeta().
|
inline |
Get an approximation of the time stored in this instance in the indicated unit.
Definition at line 399 of file nstime.h.
References FS, and ToInteger().
Referenced by DataRateTestCase::CheckTimesEqual(), ns3::HtPhy::GetPayloadDuration(), ns3::OfdmPhy::GetPayloadDuration(), and ns3::HePhy::GetSigBDuration().
|
inline |
Get an approximation of the time stored in this instance in the indicated unit.
Definition at line 371 of file nstime.h.
References H, and ToDouble().
|
inline |
Get the raw time value, in the current resolution unit.
Definition at line 423 of file nstime.h.
References GetTimeStep().
Referenced by ns3::DistributedSimulatorImpl::CalculateLookAhead(), TimeSimpleTestCase::DoRun(), RttEstimatorTestCase::DoRun(), ns3::BsmApplication::GenerateWaveTraffic(), ns3::RttMeanDeviation::IntegerUpdate(), ns3::NullMessageMpiInterface::SendNullMessage(), ns3::GrantedTimeWindowMpiInterface::SendPacket(), ns3::NullMessageMpiInterface::SendPacket(), ns3::BsmApplication::StartApplication(), and anonymous_namespace{traced-value-callback-typedef-test-suite.cc}::TracedValueCbSink< Time >().
|
inline |
Get an approximation of the time stored in this instance in the indicated unit.
Definition at line 387 of file nstime.h.
References ToInteger(), and US.
Referenced by ns3::DsssPpdu::DsssPpdu(), ns3::dot11s::IeBeaconTiming::BeaconIntervalToU16(), OfdmaAckSequenceTest::CheckResults(), CheckT1QueueSize(), CheckT2QueueSize(), CoDelQueueDiscBasicDrop::Dequeue(), CoDelQueueDiscBasicMark::Dequeue(), LrWpanSlottedCsmacaTestCase::DoRun(), ns3::dot11s::HwmpProtocol::GetActivePathLifetime(), ns3::ApWifiMac::GetEdcaParameterSet(), Ns3TcpLossTestCase::Ipv4L3Tx(), Ns3TcpStateTestCase::Ipv4L3Tx(), PacketDequeue(), ns3::MinstrelWifiManager::PrintTable(), ns3::MeshWifiInterfaceMac::SendBeacon(), ns3::dot11s::HwmpProtocol::SendProactivePreq(), ns3::dot11s::PeerLink::SetBeaconInformation(), ns3::ApWifiMac::SetBeaconInterval(), ns3::dot11s::PeerLink::SetConfirmTimer(), ns3::dot11s::PeerLink::SetHoldingTimer(), ns3::MuEdcaParameterSet::SetMuEdcaTimer(), ns3::dot11s::PeerLink::SetRetryTimer(), ns3::Txop::SetTxopLimit(), ns3::MinstrelHtWifiManager::StatsDump(), ns3::dot11s::IeBeaconTiming::TimestampToU16(), ns3::MinstrelWifiManager::UpdateStats(), and ns3::PcapFileWrapper::Write().
|
inline |
Get an approximation of the time stored in this instance in the indicated unit.
Definition at line 383 of file nstime.h.
References MS, and ToInteger().
Referenced by ns3::aodv::RrepHeader::RrepHeader(), ns3::DefaultChannelScheduler::AssignExtendedAccess(), ns3::PieQueueDisc::CalculateP(), ns3::TcpLedbat::CongestionAvoidance(), ns3::TraceFadingLossModel::DoCalcRxPowerSpectralDensity(), ns3::PieQueueDisc::DoEnqueue(), ns3::A3RsrpHandoverAlgorithm::DoInitialize(), ns3::LteRlcAm::DoReportBufferStatus(), ns3::LteRlcTm::DoReportBufferStatus(), ns3::LteRlcUm::DoReportBufferStatus(), LteUeMeasurementsHandoverTestCase::DoRun(), LenaDataPhyErrorModelTestCase::DoRun(), LenaDlCtrlPhyErrorModelTestCase::DoRun(), ns3::TcpOptionTS::ElapsedTimeFromTsValue(), ns3::LteSpectrumPhy::EndRxData(), ns3::QKDBuffer::FetchDeltaTime(), ns3::ChannelCoordinator::GetIntervalTime(), LteHandoverTargetTestCase::HandoverStartCallback(), ns3::TcpYeah::IncreaseWindow(), TcpVegasTest::IncreaseWindow(), ns3::TcpBbr::InitPacingRate(), ns3::TraceFadingLossModel::LoadTrace(), ChannelCoordinationTestCase::NotifyCchStartNow(), ChannelCoordinationTestCase::NotifyGuardStartNow(), ChannelCoordinationTestCase::NotifySchStartNow(), ns3::TcpOptionTS::NowToTsValue(), PingRtt(), ns3::TcpLp::PktsAcked(), ns3::TcpYeah::PktsAcked(), ns3::TcpHybla::RecalcParam(), TcpIllinoisTest::RecalcParam(), ns3::TcpIllinois::RecalcParam(), ns3::V4Ping::Receive(), ns3::LteUePhy::ReceiveLteControlMessageList(), LteUeMeasurementsPiecewiseTestCase1::RecvMeasurementReportCallback(), LteUeMeasurementsPiecewiseTestCase2::RecvMeasurementReportCallback(), LteUeMeasurementsPiecewiseTestCase3::RecvMeasurementReportCallback(), LteUeMeasurementsHandoverTestCase::RecvMeasurementReportCallback(), ns3::UanHeaderRcData::Serialize(), ns3::UanHeaderRcRts::Serialize(), ns3::UanHeaderRcCtsGlobal::Serialize(), ns3::UanHeaderRcCts::Serialize(), ns3::aodv::RrepHeader::SetHello(), ns3::aodv::RrepHeader::SetLifeTime(), ns3::ChannelCoordinator::StartChannelCoordination(), ns3::LteEnbPhy::StartSubFrame(), and ChannelCoordinationTestCase::TestIntervalAfter().
|
inline |
Get an approximation of the time stored in this instance in the indicated unit.
Definition at line 375 of file nstime.h.
References MIN, and ToDouble().
|
inline |
Get an approximation of the time stored in this instance in the indicated unit.
Definition at line 391 of file nstime.h.
References NS, and ToInteger().
Referenced by ns3::HtPpdu::HtPpdu(), ns3::VhtPpdu::VhtPpdu(), ns3::AcousticModemEnergyModel::ChangeState(), ns3::CoDelGetTime(), ns3::ConvertGuardIntervalToNanoSeconds(), ns3::HePhy::ConvertHeTbPpduDurationToLSigLength(), CobaltQueueDiscMarkTest::Dequeue(), ns3::LteRlcAm::DoReceivePdu(), ns3::LteRlcUm::DoReceivePdu(), ns3::LteRlcSm::DoReceivePdu(), ns3::LtePdcp::DoReceivePdu(), TimeSimpleTestCase::DoRun(), TimeInputOutputTestCase::DoRun(), OcbWifiMacTestCase::DoRun(), anonymous_namespace{sample-show-progress.cc}::Hold::Event(), ns3::HtPhy::GetPayloadDuration(), ns3::OfdmPhy::GetPayloadDuration(), ns3::HePhy::GetSigBDuration(), ns3::HePpdu::GetTxDuration(), ns3::VhtPpdu::GetTxDuration(), ns3::HePhy::GetValidPpduDuration(), SimulatorEventsTestCase::NowUs(), TimestampTag::Serialize(), ns3::PdcpTag::Serialize(), ns3::RlcTag::Serialize(), ns3::WifiMacHeader::SetDuration(), ns3::HePpdu::SetPhyHeaders(), ns3::CoDelQueueDisc::Time2CoDel(), ns3::CobaltQueueDisc::Time2CoDel(), ns3::BasicEnergyHarvester::UpdateHarvestedPower(), and ns3::PcapFileWrapper::Write().
|
inline |
Get an approximation of the time stored in this instance in the indicated unit.
Definition at line 395 of file nstime.h.
References PS, and ToInteger().
|
static |
Definition at line 373 of file time.cc.
Referenced by ns3::DefaultTimePrinter(), and ns3::operator<<().
|
inline |
Get an approximation of the time stored in this instance in the indicated unit.
Definition at line 379 of file nstime.h.
References S, and ToDouble().
Referenced by ns3::RttEstimator::RttEstimator(), ns3::dot11s::HwmpRtable::AddReactivePath(), ns3::AsciiPhyReceiveSinkWithContext(), ns3::AsciiPhyReceiveSinkWithoutContext(), ns3::AsciiPhyRxOkEvent(), ns3::AsciiPhyTransmitSinkWithContext(), ns3::AsciiPhyTransmitSinkWithoutContext(), ns3::AsciiPhyTxEvent(), ns3::WimaxHelper::AsciiRxEvent(), ns3::WimaxHelper::AsciiTxEvent(), ns3::RandomWalk2dOutdoorMobilityModel::AvoidBuilding(), BackoffTrace(), BytesInQueueTrace(), ns3::ThreeGppSpectrumPropagationLossModel::CalcBeamformingGain(), ns3::InterferenceHelper::CalculateChunkSuccessRate(), ns3::SimpleOfdmWimaxPhy::CalculateDataRate(), ns3::PieQueueDisc::CalculateP(), ns3::InterferenceHelper::CalculatePayloadChunkSuccessRate(), ns3::LiIonEnergySource::CalculateRemainingEnergy(), TcpYeahDecrementTest::CalculateSsThresh(), CalculateThroughput(), ns3::MinstrelHtWifiManager::CalculateThroughput(), ns3::LteUeRrc::CancelEnteringTrigger(), ns3::LteUeRrc::CancelLeavingTrigger(), ns3::LrWpanCsmaCa::CanProceed(), ns3::AcousticModemEnergyModel::ChangeState(), ns3::WifiRadioEnergyModel::ChangeState(), CheckQueueDiscSize(), CheckQueueSize(), CheckT1QueueSize(), CheckT2QueueSize(), ThreeGppHttpObjectTestCase::ClientRxDelayCallback(), ThreeGppHttpObjectTestCase::ClientRxRttCallback(), ns3::CobaltQueueDisc::CobaltShouldDrop(), ns3::UanMacRcGw::ComputeAlpha(), ns3::UanMacRcGw::ComputeExpS(), ComputeSnr(), Ns2MobilityHelperTest::CourseChange(), WaypointMobilityModelNotifyTest::CourseChangeCallback(), ns3::QKDKeyManagerSystemApplication::CreateNew004Association(), ns3::AnimationInterface::CsmaPhyTxEndTrace(), CwndChange(), CwndTrace(), CwndTracer(), Ns3TcpLossTestCase::CwndTracer(), CwTrace(), LrWpanDataIfsTestCase::DataReceivedDev0(), LrWpanDataIfsTestCase::DataReceivedDev1(), ns3::AsciiTraceHelper::DefaultDequeueSinkWithContext(), ns3::AsciiTraceHelper::DefaultDequeueSinkWithoutContext(), ns3::AsciiTraceHelper::DefaultDropSinkWithContext(), ns3::AsciiTraceHelper::DefaultDropSinkWithoutContext(), ns3::AsciiTraceHelper::DefaultEnqueueSinkWithContext(), ns3::AsciiTraceHelper::DefaultEnqueueSinkWithoutContext(), ns3::AsciiTraceHelper::DefaultReceiveSinkWithContext(), ns3::AsciiTraceHelper::DefaultReceiveSinkWithoutContext(), CobaltQueueDiscCeThresholdTest::DequeueWithDelay(), CobaltQueueDiscEnhancedBlueTest::DequeueWithDelay(), ns3::AnimationInterface::DevTxTrace(), ns3::MacStatsCalculator::DlScheduling(), ns3::TraceFadingLossModel::DoCalcRxPowerSpectralDensity(), ns3::CoDelQueueDisc::DoDequeue(), ns3::PieQueueDisc::DoDequeue(), ns3::TbfQueueDisc::DoDequeue(), ns3::SimpleOfdmWimaxPhy::DoGetFrameDurationCode(), ns3::SimpleOfdmWimaxPhy::DoGetNrBytes(), ns3::SimpleOfdmWimaxPhy::DoGetNrSymbols(), ns3::Rip::DoInitialize(), ns3::RipNg::DoInitialize(), ns3::dot11s::HwmpProtocol::DoInitialize(), ns3::MeshWifiInterfaceMac::DoInitialize(), TimeWithSignTestCase::DoRun(), TcpHyblaIncrementTest::DoRun(), TcpVenoTest::DoRun(), ns3::SimpleOfdmWimaxPhy::DoSetPhyParameters(), ns3::RandomWalk2dOutdoorMobilityModel::DoWalk(), ns3::GaussMarkovMobilityModel::DoWalk(), ns3::RandomWalk2dMobilityModel::DoWalk(), DropAtQueue(), ns3::PieQueueDisc::DropEarly(), DroppingStateTracer(), ns3::LteChunkProcessor::End(), ns3::BaseStationNetDevice::EndDlSubFrame(), ns3::BaseStationNetDevice::EndUlSubFrame(), CobaltQueueDiscCeThresholdTest::EnqueueWithDelay(), ns3::TcpWestwood::EstimateBW(), ns3::LteChunkProcessor::EvaluateChunk(), ns3::ShannonSpectrumErrorModel::EvaluateChunk(), EveryDropTracer(), anonymous_namespace{sample-simulator.cc}::ExampleFunction(), ns3::SpectrumAnalyzer::GenerateReport(), ns3::TcpRateLinux::GenerateSample(), GenerateTraffic(), ns3::QKDBuffer::GetAverageKeyConsumptionRate(), ns3::UanMacRcGw::GetExpPdk(), ns3::LrWpanCsmaCa::GetTimeToNextSlot(), ns3::SimpleDeviceEnergyModel::GetTotalEnergyConsumption(), ns3::WifiRadioEnergyModel::GetTotalEnergyConsumption(), ns3::JakesProcess::Oscillator::GetValueAt(), GoodputSampling(), anonymous_namespace{sample-simulator.cc}::MyModel::HandleEvent(), Ipv4DynamicGlobalRoutingTestCase::HandleRead(), ns3::TcpVegas::IncreaseWindow(), ns3::TcpVeno::IncreaseWindow(), ns3::TcpYeah::IncreaseWindow(), TcpYeahIncrementTest::IncreaseWindow(), InFlightTracer(), ns3::RedQueueDisc::InitializeParams(), ns3::TcpBbr::InitPacingRate(), ns3::SubscriberStationNetDevice::InitSubscriberStationNetDevice(), ns3::RraaWifiManager::InitThresholds(), ns3::RrpaaWifiManager::InitThresholds(), ns3::Ipv4L3ProtocolDropSinkWithContext(), ns3::Ipv4L3ProtocolDropSinkWithoutContext(), ns3::Ipv4L3ProtocolRxSinkWithContext(), ns3::Ipv4L3ProtocolRxSinkWithoutContext(), ns3::Ipv4L3ProtocolTxSinkWithContext(), ns3::Ipv4L3ProtocolTxSinkWithoutContext(), ns3::Ipv6L3ProtocolDropSinkWithContext(), ns3::Ipv6L3ProtocolDropSinkWithoutContext(), ns3::Ipv6L3ProtocolRxSinkWithContext(), ns3::Ipv6L3ProtocolRxSinkWithoutContext(), ns3::Ipv6L3ProtocolTxSinkWithContext(), ns3::Ipv6L3ProtocolTxSinkWithoutContext(), ns3::ArpCache::Entry::IsExpired(), LimitsTrace(), MacRxTrace(), MacTxTrace(), ns3::LrWpanMac::McpsDataRequest(), modify(), ns3::TcpSocketBase::NewAck(), NextRxTracer(), NextTxTracer(), ns3::operator*(), ns3::operator<<(), PacingRateTracer(), PacketDequeue(), PhyStateTrace(), PhyTxTrace(), ns3::TcpHtcp::PktsAcked(), ns3::Ipv4RoutingHelper::PrintArpCache(), ns3::Ipv4RoutingHelper::PrintArpCacheEvery(), PrintFairness(), IpAddressHelper::PrintIpAddresses(), PrintPosition(), PrintProgress(), PrintReceivedPacket(), PrintThroughput(), ns3::QKDGraph::ProcessMCurrent(), ns3::QKDTotalGraph::ProcessMCurrent(), ns3::QKDGraph::ProcessMStatus(), ns3::QKDTotalGraph::ProcessMThr(), ns3::QKDGraph::ProcessMThrStatus(), ns3::QKDKeyManagerSystemApplication::PurgeExpiredAssociations(), ns3::AnimationInterface::PurgePendingPackets(), ns3::LrWpanCsmaCa::RandomBackoffDelay(), anonymous_namespace{sample-simulator.cc}::RandomFunction(), ns3::RandomWalk2dOutdoorMobilityModel::Rebound(), RemainingEnergyTrace(), anonymous_namespace{sample-log-time-format.cc}::ReplacementTimePrinter(), ns3::MeshHelper::Report(), ns3::dot11s::HwmpProtocol::Report(), ns3::dot11s::PeerLink::Report(), ns3::flame::FlameProtocol::Report(), ns3::MeshWifiInterfaceMac::Report(), ns3::PhyStatsCalculator::ReportCurrentCellRsrpSinr(), ns3::PhyStatsCalculator::ReportInterference(), ns3::FlowMonitor::ReportLastRx(), ns3::PhyStatsCalculator::ReportUeSinr(), SampleEmitter::Reschedule(), NetAnimExperiment::ResetData(), Experiment::ResetData(), ns3::TcpSocketBase::ReTxTimeout(), TcpBytesInFlightTest::RTOExpired(), RtoTracer(), TcpRttEstimationTest::RttTrace(), RttTracer(), Experiment::Run(), RxEvent(), RxTracer(), ns3::DhcpServer::SendAck(), ns3::TcpSocketBase::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), ns3::TcpSocketBase::SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), ns3::DhcpServer::SendOffer(), ns3::TcpGeneralTest::SendPacket(), ns3::Rip::SendTriggeredRouteUpdate(), ns3::RipNg::SendTriggeredRouteUpdate(), ns3::Rip::SendUnsolicitedRouteUpdate(), ns3::RipNg::SendUnsolicitedRouteUpdate(), ns3::dot11s::PeerLink::SetBeaconInformation(), ns3::SimpleDeviceEnergyModel::SetCurrentA(), ns3::ThreeGppHttpVariables::SetEmbeddedObjectGenerationDelay(), ns3::olsr::MessageHeader::Hello::SetHTime(), ns3::ThreeGppHttpVariables::SetMainObjectGenerationDelay(), ns3::ThreeGppHttpVariables::SetParsingTimeMean(), ns3::ThreeGppHttpVariables::SetReadingTimeMean(), ns3::DhcpHeader::SetTime(), NodeStatistics::SetupPhy(), ns3::TimeProbe::SetValue(), ns3::olsr::MessageHeader::SetVTime(), showPosition(), SocketPrinter(), SocketSendTrace(), SsThreshTracer(), ns3::UanMacRcGw::StartCycle(), ns3::BaseStationNetDevice::StartDlSubFrame(), Ns3TcpLossTestCase::StartFlow(), Ns3TcpStateTestCase::StartFlow(), ns3::BaseStationNetDevice::StartFrame(), ns3::BaseStationNetDevice::StartUlSubFrame(), NodeStatistics::StateCallback(), TcPacketsInQueue(), TestDeterministicByTime(), Throughput(), TraceDrop(), TraceDropsFrequency(), TraceMark(), TraceMarksFrequency(), TraceN0Cwnd(), TraceN0Rtt(), TraceN0Throughput(), TraceN1Cwnd(), TraceN1Rtt(), TraceN1Throughput(), TracePingRtt(), TraceQueueLength(), ns3::TimeProbe::TraceSink(), TcpPacingTest::Tx(), TxTracer(), ns3::MacStatsCalculator::UlScheduling(), ns3::TcpCubic::Update(), ns3::ConstantVelocityHelper::Update(), ns3::TcpBbr::UpdateAckAggregation(), ns3::TcpHtcp::UpdateAlpha(), ns3::TcpLedbat::UpdateBaseDelay(), TcpPacingTest::UpdateExpectedInterval(), ns3::BasicEnergyHarvester::UpdateHarvestedPower(), ns3::QKDBuffer::UpdateKeyConsumptionStatistics(), ns3::QKDBuffer::UpdateKeyGenerationStatistics(), ns3::TcpSocketBase::UpdatePacingRate(), ns3::WriteAveragePowerSpectralDensityReport(), ns3::RadioBearerStatsCalculator::WriteDlResults(), ns3::RadioBearerStatsCalculator::WriteUlResults(), Ns3TcpLossTestCase::WriteUntilBufferFull(), and Ns3TcpStateTestCase::WriteUntilBufferFull().
|
inline |
Get the raw time value, in the current resolution unit.
Definition at line 415 of file nstime.h.
References m_data.
Referenced by ns3::LrWpanPhy::EndEd(), ns3::LrWpanPhy::EndRx(), ns3::WaveformGenerator::GenerateWaveform(), GetInteger(), ns3::Radvd::HandleRead(), ns3::Synchronizer::NanosecondToTimeStep(), ns3::DistributedSimulatorImpl::NextTs(), ns3::OmnetDataOutput::OmnetOutputCallback::OutputSingleton(), ns3::SqliteDataOutput::SqliteOutputCallback::OutputSingleton(), ns3::RealtimeSimulatorImpl::ProcessOneEvent(), ns3::DefaultSimulatorImpl::Schedule(), ns3::RealtimeSimulatorImpl::Schedule(), ns3::DistributedSimulatorImpl::Schedule(), ns3::NullMessageSimulatorImpl::Schedule(), ns3::RealtimeSimulatorImpl::ScheduleRealtimeWithContext(), ns3::DefaultSimulatorImpl::ScheduleWithContext(), ns3::RealtimeSimulatorImpl::ScheduleWithContext(), ns3::DistributedSimulatorImpl::ScheduleWithContext(), ns3::NullMessageSimulatorImpl::ScheduleWithContext(), ns3::NullMessageMpiInterface::SendNullMessage(), ns3::GrantedTimeWindowMpiInterface::SendPacket(), ns3::NullMessageMpiInterface::SendPacket(), AnnexC_TestCase::SendPacket(), ChannelAccessTestCase::SendX(), ns3::SeqTsEchoHeader::Serialize(), ns3::DelayJitterEstimationTimestampTag::Serialize(), ns3::AmpduTag::Serialize(), ns3::ThreeGppHttpHeader::SetClientTs(), ns3::ThreeGppHttpHeader::SetServerTs(), ns3::LrWpanPhy::StartRx(), ns3::DefaultSimulatorImpl::Stop(), ns3::DistributedSimulatorImpl::Stop(), ns3::NullMessageSimulatorImpl::Stop(), TimeSimpleTestCase::TestDivisionByIntegerTypes(), TimeSimpleTestCase::TestMultiplicationByIntegerTypes(), and ns3::DesMetrics::TraceWithContext().
|
inline |
Get an approximation of the time stored in this instance in the indicated unit.
Definition at line 363 of file nstime.h.
References ToDouble(), and Y.
|
inline |
Exactly equivalent to t <= 0
.
true
if the time is negative or zero, false
otherwise. Definition at line 308 of file nstime.h.
References m_data.
Referenced by ns3::QosFrameExchangeManager::IsWithinSizeAndTimeLimits(), and ns3::RrMultiUserScheduler::TrySendingBasicTf().
|
inline |
Exactly equivalent to t >= 0
.
true
if the time is positive or zero, false
otherwise. Definition at line 316 of file nstime.h.
References m_data.
Referenced by ThreeGppHttpObjectTestCase::ThreeGppHttpObjectTestCase(), ns3::BasicEnergySource::CalculateRemainingEnergy(), ns3::WifiRadioEnergyModel::ChangeState(), ns3::WifiRadioEnergyModel::GetTotalEnergyConsumption(), ns3::TcpLedbat::PktsAcked(), ns3::DefaultSimulatorImpl::Schedule(), ns3::RealtimeSimulatorImpl::Schedule(), ns3::DistributedSimulatorImpl::Schedule(), ns3::NullMessageSimulatorImpl::Schedule(), and ns3::NullMessageSimulatorImpl::ScheduleWithContext().
|
inline |
Exactly equivalent to t < 0
.
true
if the time is strictly negative, false
otherwise. Definition at line 324 of file nstime.h.
References m_data.
Referenced by ns3::FrameExchangeManager::DoSendCtsAfterRts(), ns3::QosTxop::GetRemainingTxop(), ns3::HtFrameExchangeManager::SendBlockAck(), ns3::FrameExchangeManager::SendNormalAck(), and ns3::WifiPhy::SetOperatingChannel().
|
inline |
Exactly equivalent to t > 0
.
true
if the time is strictly positive, false
otherwise. Definition at line 332 of file nstime.h.
References m_data.
Referenced by ns3::InterferenceHelper::CalculatePhyHeaderSectionPsr(), ns3::WifiPhy::CalculateTxDuration(), ns3::HePhy::CalculateTxDuration(), ns3::QosTxop::GetRemainingTxop(), ns3::WifiDefaultAckManager::IsResponseNeeded(), ns3::QosFrameExchangeManager::IsWithinSizeAndTimeLimits(), ns3::WifiPhyStateHelper::LogPreviousIdleAndCcaBusyStates(), ns3::QosTxop::MuEdcaTimerRunning(), ns3::QosTxop::NotifyChannelReleased(), ns3::Ipv4L3Protocol::RemoveDuplicates(), ns3::FrameExchangeManager::RxStartIndication(), ns3::QosFrameExchangeManager::SendCfEndIfNeeded(), ns3::MuEdcaParameterSet::SetMuEdcaTimer(), ns3::WifiPhy::SetOperatingChannel(), ns3::QosFrameExchangeManager::StartTransmission(), ns3::QosFrameExchangeManager::TransmissionFailed(), ns3::QosFrameExchangeManager::TransmissionSucceeded(), and ns3::Ipv4L3Protocol::UpdateDuplicate().
|
inline |
Exactly equivalent to t == 0
.
true
if the time is zero, false
otherwise. Definition at line 300 of file nstime.h.
References m_data.
Referenced by ns3::InterferenceHelper::CalculateChunkSuccessRate(), ns3::InterferenceHelper::CalculatePayloadChunkSuccessRate(), ns3::ThreeGppChannelModel::ChannelParamsNeedsUpdate(), WifiPrimaryChannelsTest::DoSendHeTbPpdu(), ns3::TcpWestwood::EstimateBW(), ns3::TcpSocketBase::EstimateRtt(), ns3::ThreeGppChannelConditionModel::GetChannelCondition(), ns3::QosFrameExchangeManager::GetCtsToSelfDurationId(), ns3::QosFrameExchangeManager::GetFrameDurationId(), ns3::HtFrameExchangeManager::GetPsduDurationId(), ns3::QosFrameExchangeManager::GetRtsDurationId(), ns3::QosTxop::IsTxopStarted(), ns3::LrWpanMac::PdDataConfirm(), ns3::TcpWestwood::PktsAcked(), ns3::TcpIllinois::PktsAcked(), ns3::TcpLp::PktsAcked(), ns3::TcpVegas::PktsAcked(), ns3::TcpVeno::PktsAcked(), ns3::TcpYeah::PktsAcked(), ns3::ThreeGppHttpClient::ReceiveEmbeddedObject(), ns3::ThreeGppHttpClient::ReceiveMainObject(), ns3::PhyEntity::ScheduleEndOfMpdus(), ns3::QosFrameExchangeManager::StartTransmission(), ns3::UanPdp::SumTapsFromMaxC(), ns3::UanPdp::SumTapsFromMaxNc(), ns3::WifiPhy::SwitchMaybeToCcaBusy(), ns3::HtFrameExchangeManager::TransmissionSucceeded(), and ns3::RrMultiUserScheduler::TrySendingBasicTf().
|
staticprivate |
Record a Time instance with the MarkedTimes.
[in] | time | The Time instance to record. |
Definition at line 317 of file time.cc.
References ns3::g_markingMutex, g_markingTimes, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, and NS_LOG_WARN.
Referenced by Time(), and SetDefaultNsResolution().
|
inlinestatic |
Maximum representable Time Not to be confused with Max(Time,Time).
Definition at line 282 of file nstime.h.
Referenced by ns3::FqCobaltQueueDisc::CheckConfig(), ns3::FqCoDelQueueDisc::CheckConfig(), ns3::FqPieQueueDisc::CheckConfig(), ns3::TcpBbr::CongestionStateSet(), ns3::PieQueueDisc::DoEnqueue(), ns3::TcpVegas::EnableVegas(), ns3::TcpVeno::EnableVeno(), ns3::TcpYeah::EnableYeah(), ns3::TcpHtcp::GetSsThresh(), ns3::ArpCache::Entry::GetTimeout(), ns3::CobaltQueueDisc::GetTypeId(), ns3::CoDelQueueDisc::GetTypeId(), ns3::FqCobaltQueueDisc::GetTypeId(), ns3::FqCoDelQueueDisc::GetTypeId(), ns3::FqPieQueueDisc::GetTypeId(), ns3::PieQueueDisc::GetTypeId(), ns3::TcpVegas::IncreaseWindow(), ns3::TcpVeno::IncreaseWindow(), ns3::TcpYeah::IncreaseWindow(), ns3::TcpBbr::InFlight(), ns3::TcpBbr::InitPacingRate(), ns3::MakeTimeChecker(), ns3::TcpBbr::SetPacingRate(), and ns3::TcpRateLinux::SkbDelivered().
|
inlinestatic |
Minimum representable Time Not to be confused with Min(Time,Time).
Definition at line 273 of file nstime.h.
Referenced by ns3::WifiTxParameters::Clear(), ns3::TcpCubic::CubicReset(), ns3::FrameExchangeManager::GetFrameDurationId(), ns3::QosFrameExchangeManager::GetFrameDurationId(), ns3::QosTxop::GetNextMpdu(), ns3::HtFrameExchangeManager::GetPsduDurationId(), ns3::TcpBic::GetSsThresh(), ns3::TcpCubic::GetSsThresh(), ns3::TcpHtcp::GetSsThresh(), ns3::TcpCubic::HystartReset(), ns3::TcpCubic::HystartUpdate(), ns3::QosFrameExchangeManager::IsWithinSizeAndTimeLimits(), ns3::MakeTimeChecker(), ns3::QosTxop::NotifyChannelAccessed(), ns3::TcpCubic::PktsAcked(), ns3::FrameExchangeManager::SendCtsToSelf(), ns3::HtFrameExchangeManager::SendMpduFromBaManager(), ns3::FrameExchangeManager::SendMpduWithProtection(), ns3::HeFrameExchangeManager::SendPsduMapWithProtection(), ns3::HtFrameExchangeManager::SendPsduWithProtection(), ns3::FrameExchangeManager::SendRts(), ns3::QosFrameExchangeManager::StartTransmission(), ns3::QosFrameExchangeManager::TryAddMpdu(), ns3::HtFrameExchangeManager::TryAggregateMsdu(), ns3::RrMultiUserScheduler::TrySendingBasicTf(), ns3::RrMultiUserScheduler::TrySendingBsrpTf(), ns3::RrMultiUserScheduler::TrySendingDlMuPpdu(), ns3::TcpBic::Update(), and ns3::TcpCubic::Update().
|
inlinestaticprivate |
Get the Information record for timeUnit for the current Resolution.
[in] | timeUnit | The Unit to get Information for |
Definition at line 615 of file nstime.h.
References ns3::Time::Resolution::info, and PeekResolution().
Referenced by From(), FromInteger(), To(), and ToInteger().
|
inlinestaticprivate |
Get the current Resolution.
Definition at line 604 of file nstime.h.
References SetDefaultNsResolution().
Referenced by PeekInformation(), and SetResolution().
Round a Time to a specific unit.
Rounding is to nearest integer.
[in] | unit | The unit to round to. |
Definition at line 555 of file nstime.h.
Referenced by ns3::UanHeaderRcData::Serialize(), ns3::UanHeaderRcRts::Serialize(), ns3::UanHeaderRcCtsGlobal::Serialize(), and ns3::UanHeaderRcCts::Serialize().
|
staticprivate |
Set the default resolution.
Definition at line 129 of file time.cc.
References D, FromDouble(), FS, g_markingTimes, H, Mark(), MIN, MS, NS, NS_ABORT_MSG, NS_LOG_FUNCTION, PS, S, US, and Y.
Referenced by PeekResolution().
|
static |
[in] | resolution | The new resolution to use |
Change the global resolution used to convert all user-provided time values in Time objects and Time objects in user-expected time units.
Definition at line 213 of file time.cc.
References NS_LOG_FUNCTION, and PeekResolution().
|
staticprivate |
Set the current Resolution.
[in] | unit | The unit to use as the new resolution. |
[in,out] | resolution | The Resolution record to update. |
[in] | convert | Whether to convert existing Time objects to the new resolution. |
Definition at line 222 of file time.cc.
References ConvertTimes(), ns3::Time::Information::factor, ns3::Time::Information::fromMul, ns3::Time::Resolution::info, ns3::int64x64_t::Invert(), LAST, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Time::Information::timeFrom, ns3::Time::Information::timeTo, ns3::Time::Information::toMul, ns3::Time::Resolution::unit, ns3::anonymous_namespace{time.cc}::UNIT_COEFF, and ns3::anonymous_namespace{time.cc}::UNIT_POWER.
|
static |
Function to force static initialization of Time.
true
on the first call Definition at line 96 of file time.cc.
References ns3::g_markingMutex, g_markingTimes, and NS_LOG_ERROR.
|
inline |
Get the Time value expressed in a particular unit.
[in] | unit | The desired unit |
Definition at line 533 of file nstime.h.
References m_data, ns3::int64x64_t::MulByInvert(), PeekInformation(), ns3::Time::Information::timeTo, and ns3::Time::Information::toMul.
Referenced by ns3::OnOffApplication::CancelEvents(), RoundTo(), and ToDouble().
|
inline |
Get the Time value expressed in a particular unit.
[in] | unit | The desired unit |
Definition at line 529 of file nstime.h.
References ns3::int64x64_t::GetDouble(), and To().
Referenced by ns3::RrMultiUserScheduler::ComputeDlMuInfo(), ns3::RttMeanDeviation::FloatingPointUpdate(), GetDays(), GetHours(), GetMinutes(), GetSeconds(), GetYears(), Ipv4DeduplicationTest::MakeName(), and SojournTimeTrace().
|
inline |
Get the Time value expressed in a particular unit.
[in] | unit | The desired unit |
Definition at line 515 of file nstime.h.
References ns3::Time::Information::factor, m_data, PeekInformation(), and ns3::Time::Information::toMul.
Referenced by ConvertTimes(), GetFemtoSeconds(), GetMicroSeconds(), GetMilliSeconds(), GetNanoSeconds(), and GetPicoSeconds().
Integer quotient from dividing two Times.
This is the same as the "normal" C++ integer division, which truncates (discarding any remainder).
As usual, if ta
, and tb
are both Times
[in] | lhs | The first value |
[in] | rhs | The second value |
lhs / rhs
.
|
related |
|
friend |
|
friend |
|
friend |
Scale a Time by a numeric value.
This overload handles the case where the scale value comes before the Time value. It swaps the arguments so that the Time argument comes first and calls the appropriate overload of operator*
T | Arithmetic data type (int, long, float, etc.) |
[in] | lhs | The scale value |
[in] | rhs | The Time instance to scale |
|
friend |
|
friend |
Exact division, returning a dimensionless fixed point number.
This can be truncated to integer, or converted to double (with loss of precison). Assuming ta
and tb
are Times:
[in] | lhs | The first value |
[in] | rhs | The second value |
|
related |
|
staticprivate |
Record of outstanding Time objects which will need conversion when the resolution is set.
Use a classic static variable so we can check in Time ctors without a function call.
We'd really like to initialize this here, but we don't want to require C++0x, so we init in time.cc. To ensure that happens before first use, we add a call to StaticInit (below) to every compilation unit which includes nstime.h.
Definition at line 670 of file nstime.h.
Referenced by Time(), ~Time(), Clear(), ClearMarkedTimes(), ConvertTimes(), Mark(), SetDefaultNsResolution(), and StaticInit().
|
private |
Virtual time value, in the current unit.
Definition at line 781 of file nstime.h.
Referenced by Compare(), ConvertTimes(), GetDouble(), GetTimeStep(), IsNegative(), IsPositive(), IsStrictlyNegative(), IsStrictlyPositive(), IsZero(), operator=(), To(), and ToInteger().