From 9a9c15a90497b8ddfd595123d2e1ed94cf6725e3 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Fri, 30 May 2008 11:05:28 +0000 Subject: [PATCH] tweak timestamps in notifications to be on minute boundary. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/performance/trunk@26587 72102866-910b-0410-8b05-ffd578937521 --- GSThroughput.m | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/GSThroughput.m b/GSThroughput.m index a2da2f7..ef029d3 100644 --- a/GSThroughput.m +++ b/GSThroughput.m @@ -228,7 +228,7 @@ typedef struct { } if (my->notify == YES && my->last > 59) { - if (info->min == MAXDURATION) + if (info->min >= MAXDURATION) { info->min = -1.0; } @@ -245,9 +245,13 @@ typedef struct { [NSNumber numberWithDouble: info->sum], GSThroughputTotalKey, [NSDate dateWithTimeIntervalSinceReferenceDate: - base + my->last - 59], + base + my->last - 60], GSThroughputTimeKey, nil]]; + if (info->min < 0.0) + { + info->min = MAXDURATION; + } } if (my->minute++ == my->minutesPerPeriod - 1) { @@ -319,7 +323,7 @@ typedef struct { [NSNumber numberWithUnsignedInt: info->cnt], GSThroughputCountKey, [NSDate dateWithTimeIntervalSinceReferenceDate: - base + my->last - 59], + base + my->last - 60], GSThroughputTimeKey, nil]]; } @@ -382,7 +386,7 @@ typedef struct { [NSNumber numberWithDouble: info->sum], GSThroughputTotalKey, [NSDate dateWithTimeIntervalSinceReferenceDate: - base + my->last - 59], + base + my->last - 60], GSThroughputTimeKey, nil]]; } @@ -404,7 +408,7 @@ typedef struct { [NSNumber numberWithUnsignedInt: info->cnt], GSThroughputCountKey, [NSDate dateWithTimeIntervalSinceReferenceDate: - base + my->last - 59], + base + my->last - 60], GSThroughputTimeKey, nil]]; }