diff --git a/src/simulator/nstime.h b/src/simulator/nstime.h index 6b6660f70..24d7fd671 100644 --- a/src/simulator/nstime.h +++ b/src/simulator/nstime.h @@ -577,6 +577,12 @@ Time PicoSeconds (uint64_t ps); */ Time FemtoSeconds (uint64_t fs); +/** + * \brief create a ns3::Time instance which represents + * the maximum value representable in a simulation. + */ +Time MaxSeconds (void); + // internal function not publicly documented Time TimeStep (uint64_t ts); diff --git a/src/simulator/time.cc b/src/simulator/time.cc index a58a54925..8751cc4d4 100644 --- a/src/simulator/time.cc +++ b/src/simulator/time.cc @@ -268,6 +268,12 @@ Time FemtoSeconds (uint64_t fs) uint64_t ts = TimeUnit<1>::UnitsToTimestep(fs, TimeStepPrecision::FS_FACTOR); return TimeStep(ts); } +Time MaxSeconds (void) +{ + // XXX: I am fairly certain other compilers use other non-standard + // post-fixes to indicate 64 bit constants. + return TimeStep (0xffffffffffffffffLL); +} /* * The timestep value passed to this function must be of the precision