Bug in low precision clock fixed.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
Martin Sustrik 2010-10-16 14:48:06 +02:00
parent 0a03e86e95
commit 61d38fbeed
2 changed files with 5 additions and 2 deletions

View File

@ -31,7 +31,7 @@
zmq::clock_t::clock_t () :
last_tsc (rdtsc ()),
last_time (now_us ())
last_time (now_us () / 1000)
{
}
@ -82,7 +82,7 @@ uint64_t zmq::clock_t::now_ms ()
return last_time;
last_tsc = tsc;
last_time = now_us ();
last_time = now_us () / 1000;
return last_time;
}

View File

@ -44,7 +44,10 @@ namespace zmq
private:
// TSC timestamp of when last time measurement was made.
uint64_t last_tsc;
// Physical time corresponding to the TSC above (in milliseconds).
uint64_t last_time;
clock_t (const clock_t&);