- minor improvements for pvqa_pcap project
This commit is contained in:
@@ -120,6 +120,11 @@ timespec chronox::toTimespec(uint64_t milliseconds)
|
||||
return r;
|
||||
}
|
||||
|
||||
uint64_t chronox::toTimestamp(const timeval& ts)
|
||||
{
|
||||
return ts.tv_sec * 1000 + ts.tv_usec / 1000;
|
||||
}
|
||||
|
||||
int64_t chronox::getDelta(const timespec& a, const timespec& b)
|
||||
{
|
||||
uint64_t ms_a = a.tv_sec * 1000 + a.tv_nsec / 10000000;
|
||||
|
||||
@@ -61,6 +61,7 @@ public:
|
||||
|
||||
// Converts number of milliseconds starting from Epoch begin to timespec.
|
||||
static timespec toTimespec(uint64_t milliseconds);
|
||||
static uint64_t toTimestamp(const timeval& ts);
|
||||
|
||||
// Returns difference between timestamps in milliseconds
|
||||
static int64_t getDelta(const timespec& a, const timespec& b);
|
||||
|
||||
Reference in New Issue
Block a user