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