mirror of
https://github.com/zeromq/libzmq.git
synced 2025-06-10 08:07:37 +02:00
Bug in low precision clock fixed.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
parent
0a03e86e95
commit
61d38fbeed
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
zmq::clock_t::clock_t () :
|
zmq::clock_t::clock_t () :
|
||||||
last_tsc (rdtsc ()),
|
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;
|
return last_time;
|
||||||
|
|
||||||
last_tsc = tsc;
|
last_tsc = tsc;
|
||||||
last_time = now_us ();
|
last_time = now_us () / 1000;
|
||||||
return last_time;
|
return last_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,10 @@ namespace zmq
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
// TSC timestamp of when last time measurement was made.
|
||||||
uint64_t last_tsc;
|
uint64_t last_tsc;
|
||||||
|
|
||||||
|
// Physical time corresponding to the TSC above (in milliseconds).
|
||||||
uint64_t last_time;
|
uint64_t last_time;
|
||||||
|
|
||||||
clock_t (const clock_t&);
|
clock_t (const clock_t&);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user