diff --git a/CHANGES.md b/CHANGES.md index 7adc84c59..22995c07f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -28,6 +28,8 @@ This file is a best-effort approach to solving this issue; we will do our best b ### Changed behavior +* (core) `RealTimeSimulatorImpl::Now` uses real time instead of the time of the last event call. + ## Changes from ns-3.43 to ns-3.44 ### New API diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index ab7fe7337..9573506f0 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -30,6 +30,8 @@ been tested on Linux. As of this release, the latest known version to work with ### New user-visible features +- (core ) !2385 - The function `Now()` will now print the real time since the beginning of the simulation instead of the real time since the last event call when `RealTimeSimulatorImpl` is used. + ### Bugs fixed - (wifi) #2368 - Fix various issues related to Content Channels and RU allocation. Fixes mostly covers cases where OFDMA is used with central 26 tones, where a single user is being assigned the whole PPDU bandwidth or where a RU is larger than 20 MHz. diff --git a/src/core/model/realtime-simulator-impl.cc b/src/core/model/realtime-simulator-impl.cc index bbaea2c9d..96d2cad26 100644 --- a/src/core/model/realtime-simulator-impl.cc +++ b/src/core/model/realtime-simulator-impl.cc @@ -573,7 +573,7 @@ RealtimeSimulatorImpl::ScheduleNow(EventImpl* impl) Time RealtimeSimulatorImpl::Now() const { - return TimeStep(m_currentTs); + return TimeStep(m_running ? m_synchronizer->GetCurrentRealtime() : m_currentTs); } //