Instrumented Nasal GC
This commit is contained in:
@@ -337,3 +337,21 @@ int SGTimeStamp::elapsedMSec() const
|
||||
|
||||
return static_cast<int>((now - *this).toMSecs());
|
||||
}
|
||||
|
||||
int SGTimeStamp::elapsedUSec() const
|
||||
{
|
||||
SGTimeStamp now;
|
||||
now.stamp();
|
||||
|
||||
return static_cast<int>((now - *this).toUSecs());
|
||||
}
|
||||
extern "C" {
|
||||
SGTimeStamp global_timestamp;
|
||||
void global_stamp() {
|
||||
global_timestamp.stamp();
|
||||
}
|
||||
extern int global_elapsedUSec()
|
||||
{
|
||||
return global_timestamp.elapsedUSec();
|
||||
}
|
||||
}
|
||||
@@ -221,9 +221,13 @@ public:
|
||||
{ return sleepFor(fromMSec(msec)); }
|
||||
|
||||
/**
|
||||
* elapsed time since the stamp was taken, in msec
|
||||
*/
|
||||
* elapsed time since the stamp was taken, in msec
|
||||
*/
|
||||
int elapsedMSec() const;
|
||||
/**
|
||||
* elapsed time since the stamp was taken, in usec
|
||||
*/
|
||||
int elapsedUSec() const;
|
||||
private:
|
||||
SGTimeStamp(sec_type sec, nsec_type nsec)
|
||||
{ setTime(sec, nsec); }
|
||||
|
||||
Reference in New Issue
Block a user