From bfcba4906fa5d085e00d91ad11dc2b80ade47c78 Mon Sep 17 00:00:00 2001 From: dummy Date: Wed, 26 Aug 2020 16:22:27 +0900 Subject: [PATCH] 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. --- collector.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/collector.c b/collector.c index 06e4d9f..4e9d882 100644 --- a/collector.c +++ b/collector.c @@ -306,11 +306,11 @@ static int64 millisecs_diff(TimestampTz tz1, TimestampTz tz2) { long secs; - int millisecs; + int microsecs; - TimestampDifference(tz1, tz2, &secs, &millisecs); + TimestampDifference(tz1, tz2, &secs, µsecs); - return secs * 1000 + millisecs; + return secs * 1000 + microsecs / 1000; }