mibuild/sim: avoid updating end at each cycle (simulation speedup)

This commit is contained in:
Florent Kermarrec 2015-03-03 18:01:14 +01:00
parent 5ec26a49c3
commit f4b060f6fe
2 changed files with 2 additions and 2 deletions

View File

@ -115,7 +115,6 @@ void sim_tick(struct sim *s)
if (trace)
tfp->dump(s->tick);
s->tick++;
s->end = clock();
}
void sim_init(struct sim *s)
@ -157,6 +156,7 @@ int main(int argc, char **argv, char **env)
s.run = false;
}
}
s.end = clock();
speed = (s.tick/2)/((s.end-s.start)/CLOCKS_PER_SEC);

View File

@ -150,7 +150,6 @@ void sim_tick(struct sim *s)
if (trace)
tfp->dump(s->tick);
s->tick++;
s->end = clock();
}
void sim_init(struct sim *s)
@ -193,6 +192,7 @@ int main(int argc, char **argv, char **env)
s.run = false;
}
}
s.end = clock();
tfp->close();
pthread_cancel(sim_receive_thread);