|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
51 m_interval (interval),
122 auto precision =
m_os->precision ();
123 auto flags =
m_os->flags ();
125 m_os->setf (std::ios::fixed, std:: ios::floatfield);
129 (*m_os) << std::right << std::setw (5) <<
m_repCount << std::left
131 << std::setprecision (9)
134 <<
" = rat: " << ratio
144 << std::setprecision (3) << std::setw (8) << speed.
GetDouble () <<
"x real time) "
145 << nEvents <<
" events processed"
150 m_os->precision (precision);
~ShowProgress(void)
Destructor.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void Start(void)
Start the elapsed wallclock timestamp and print the start time.
ns3::ShowProgress declaration.
ns3::EventId declarations.
uint64_t m_eventCount
Simulator event count.
std::string ToString(void) const
Get the last time stamp as a string.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void Stop(void)
Stop the elapsed wallclock timestamp and print the total elapsed time.
double GetDouble(void) const
Get this value as a double.
Time m_elapsed
Total elapsed wallclock time since last update.
TimePrinter m_printer
The TimePrinter to use.
TimeWithUnit As(const enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
High precision numerical type, implementing Q64.64 fixed precision.
SystemWallClockMs m_timer
Wallclock timer.
static const int64x64_t MAXGAIN
Maximum growth factor.
std::ostream * m_os
The output stream to use.
void GiveFeedback(uint64_t nEvents, int64x64_t ratio, int64x64_t speed)
Show execution progress.
void SetVerbose(bool verbose)
Set verbose mode to print real and virtual time intervals.
EventId m_event
The next progress event.
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time m_interval
The target update interval, in wallclock time.
void SetStream(std::ostream &os)
Set the output stream to show progress on.
Simulation virtual time values and global simulation resolution.
bool m_verbose
Verbose mode flag.
Time m_vtime
The virtual time interval.
std::time_t GetInterval(void) const
Get the last recorded interval.
void SetInterval(const Time interval)
Set the target update interval, in wallclock time.
void DefaultTimePrinter(std::ostream &os)
Default Time printer.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
static const int64x64_t HYSTERESIS
Hysteresis factor.
ns3::Simulator declaration.
void(* TimePrinter)(std::ostream &os)
Function signature for features requiring a time formatter, such as logging or ShowProgress.
double f(double x, void *params)
void SetTimePrinter(TimePrinter lp)
Set the TimePrinter function to be used to prepend progress messages with the simulation time.
static uint64_t GetEventCount(void)
Get the number of events executed.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Declaration of classes ns3::Time and ns3::TimeWithUnit, and the TimeValue implementation classes.
void Start(void)
Start a measure.
void CheckProgress(void)
Check on execution progress.
int64_t End(void)
Stop measuring the time since Start() was called.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
void ScheduleCheckProgress(void)
Schedule the next CheckProgress.
void Stamp(void)
Record the current wall-clock time and delta since the last stamp().
ShowProgress(const Time interval=Seconds(1.0), std::ostream &os=std::cout)
Constructor.
uint64_t m_repCount
Number of CheckProgress events.
SystemWallClockTimestamp m_stamp
Elapsed wallclock time.