aboutsummaryrefslogtreecommitdiff
path: root/src/simulator.cc
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2021-07-02 10:25:56 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2021-07-02 10:25:56 +0200
commitd6db829f9d98bb909107f08b0461272b2c21ab0e (patch)
tree42fb64f37c03a338c4bbca184dd4bb07b71783df /src/simulator.cc
parent4d107863208d72ee755b6de2392bcba0372a40fa (diff)
Debug simulator
Diffstat (limited to 'src/simulator.cc')
-rw-r--r--src/simulator.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/simulator.cc b/src/simulator.cc
index 865aabc..a0b55bd 100644
--- a/src/simulator.cc
+++ b/src/simulator.cc
@@ -285,6 +285,9 @@ static void obs_node(std::vector<std::string> args) {
}
if(i.shutdown_on_rcv)
upuntil=CLOCK;
+ // Check if we use unschedule_on_rcv
+ if(i.unschedule_on_rcv)
+ i.ResetEvents(CLOCK);
nDataRcv++;
isObserver=true;
is_sender=false;
@@ -344,11 +347,9 @@ static void obs_node(std::vector<std::string> args) {
uptime=upuntil-CLOCK; // Note that uptime can be < 0 in extended mode
uptime=uptime > 0 ? uptime : 0; // Just in case
}
- // Check if we use unschedule_on_rcv
- if(i.unschedule_on_rcv)
- i.ResetEvents(CLOCK);
// Load next event
i.GotoNextEvent();
+
nWakeUp++; // Increase the number of wake up
totalUptime+=CLOCK-upsince; // Synchronize total uptime
}