summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2011-01-15 07:48:25 -0800
committerNathan Binkert <nate@binkert.org>2011-01-15 07:48:25 -0800
commit318bfe9d4f4308321dfa923d3da36230fc98d62e (patch)
treeb1bc3ef3a778ed7c2a6fd263f06728c861d73fce /src/sim
parentc82a8979a3909037a1654fc66cb215b5bacadb08 (diff)
downloadgem5-318bfe9d4f4308321dfa923d3da36230fc98d62e.tar.xz
time: improve time datastructure
Use posix clock functions (and librt) if it is available. Inline a bunch of functions and implement more operators. * * * time: more cleanup
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/stat_control.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sim/stat_control.cc b/src/sim/stat_control.cc
index f2c7c8a2e..ad1d4a9e4 100644
--- a/src/sim/stat_control.cc
+++ b/src/sim/stat_control.cc
@@ -65,7 +65,7 @@ struct SimTicksReset : public Callback
{
void process()
{
- statTime.set();
+ statTime.setTimer();
startTick = curTick();
}
};
@@ -73,9 +73,11 @@ struct SimTicksReset : public Callback
double
statElapsedTime()
{
- Time now(true);
+ Time now;
+ now.setTimer();
+
Time elapsed = now - statTime;
- return elapsed();
+ return elapsed;
}
Tick