diff --git a/checkin_notes b/checkin_notes index 1955c420e8..7401a8eaba 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6626,3 +6626,10 @@ David 2 Nov 2012 sched_send.cpp tools/ upgrade + +Rom 4 Nov 2012 + - VBOX: Do not count the sleep time as part of the elapsed time when + the VM is supposed to be suspended. + + samples\vboxwrapper\ + vboxwrapper.cpp diff --git a/samples/vboxwrapper/vboxwrapper.cpp b/samples/vboxwrapper/vboxwrapper.cpp index 70982500c5..8b8f843834 100644 --- a/samples/vboxwrapper/vboxwrapper.cpp +++ b/samples/vboxwrapper/vboxwrapper.cpp @@ -792,17 +792,20 @@ int main(int argc, char** argv) { stopwatch_endtime = dtime(); - // Calculate the elapsed time after all potiential commands have been executed - // and base it off of wall clock time instead of a fixed interval. - if (!boinc_status.suspended) { - elapsed_time += stopwatch_endtime - stopwatch_time; - } - // Sleep for the remainder of the polling period sleep_time = POLL_PERIOD - (stopwatch_endtime - stopwatch_time); if (sleep_time > 0) { boinc_sleep(sleep_time); - elapsed_time += sleep_time; + } + + // Calculate the elapsed time after all potiential commands have been executed + // and base it off of wall clock time instead of a fixed interval. + if (!boinc_status.suspended) { + if (sleep_time > 0) { + elapsed_time += sleep_time; + } else { + elapsed_time += stopwatch_endtime - stopwatch_time; + } } }