typedef typename DESC::timestamp timestamp;
timestamp base_time;
-
+
using DESC::get_current_time;
using DESC::realtime;
using DESC::one_second;
void reset()
{ get_current_time(base_time); }
-
+
value_type operator()()const
{ return timestamp_to_seconds(get_current_time()-base_time); }
{
// Grab the old base time
timestamp old_time=base_time;
-
+
// Put the current time into base_time
get_current_time(base_time);
-
+
return timestamp_to_seconds(base_time-old_time);
}
-
+
static void
sleep(const value_type &length)
{
/* This is a different waiting mechanism that uses
** the native timestamp type of the clock rather
** than converting it to a double (or whatever).
- ** You would think that this would be at least a
+ ** You would think that this would be at least a
** few microseconds faster, but a few tests on my
** PowerBook G4 have proved otherwise. Indeed I loose
** several microseconds using this "optimized" method.
while(get_current_time()<endtime);
}
*/
-
+
return;
}
};