Simplify time tracking loop

This commit is contained in:
Magnus Ulimoen 2021-08-17 13:40:23 +00:00
parent ed81ba995f
commit 67884c38c6
1 changed files with 3 additions and 6 deletions

View File

@ -115,15 +115,12 @@ fn main() {
let mut itime = 0;
while itime < ntime {
sys.advance(steps_between_outputs);
let nexttime = (itime + steps_between_outputs).max(ntime);
sys.advance(nexttime - itime);
itime += steps_between_outputs;
itime = nexttime;
sys.output(itime);
}
if itime != ntime {
sys.advance(ntime - itime);
sys.output(ntime);
}
if !opt.no_progressbar {
sys.finish_progressbar();