src/simulator/realtime-simulator-impl.cc
changeset 3800 804beebf1ba5
parent 3799 ceea04d07e60
child 3801 dc1f5e534e56
--- a/src/simulator/realtime-simulator-impl.cc	Fri Oct 10 16:43:43 2008 -0700
+++ b/src/simulator/realtime-simulator-impl.cc	Fri Oct 10 21:01:50 2008 -0700
@@ -657,7 +657,11 @@
   {
     CriticalSection cs (m_mutex);
 
-    uint64_t ts = m_synchronizer->GetCurrentRealtime ();
+    //
+    // If the simulator is running, we're pacing and have a meaningful 
+    // realtime clock.  If we're not, then m_currentTs is were we stopped.
+    // 
+    uint64_t ts = m_running ? m_synchronizer->GetCurrentRealtime () : m_currentTs;
     NS_ASSERT_MSG (ts >= m_currentTs, "RealtimeSimulatorImpl::ScheduleRealNow(): schedule for time < m_currentTs");
     id = EventId (event, ts, m_uid);
     m_uid++;