From 318bfe9d4f4308321dfa923d3da36230fc98d62e Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Sat, 15 Jan 2011 07:48:25 -0800 Subject: 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 --- src/sim/stat_control.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/sim') 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 -- cgit v1.2.3