Skip to content

Commit bfcba49

Browse files
author
dummy
committed
Fix millisecond calculation for millisecs_diff()
Previously, millisecs_diff() did not return milliseconds correctly, so it was not collecting according to the period settings for the profile and history.
1 parent d61a869 commit bfcba49

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

collector.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,11 @@ static int64
306306
millisecs_diff(TimestampTz tz1, TimestampTz tz2)
307307
{
308308
long secs;
309-
int millisecs;
309+
int microsecs;
310310

311-
TimestampDifference(tz1, tz2, &secs, &millisecs);
311+
TimestampDifference(tz1, tz2, &secs, &microsecs);
312312

313-
return secs * 1000 + millisecs;
313+
return secs * 1000 + microsecs / 1000;
314314

315315
}
316316

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy