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