From fc418d35b04c1dcfe6a3b146e10798a6ff33fad1 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 27 Feb 2015 19:36:45 -0800 Subject: [PATCH 1/2] scripts/supybot: round total CPU time to 2 decimal places This prevents rather silly things such as 0.9400000000001 from showing up. (cherry picked from commit GLolol/Limnoria@2d5e936f0d10329bc7a92b11dcb9f1887746a080) --- scripts/supybot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/supybot b/scripts/supybot index a658ea78a..03fc0daeb 100644 --- a/scripts/supybot +++ b/scripts/supybot @@ -132,7 +132,7 @@ def main(): seconds = now - world.startedAt log.info('Total uptime: %s.', utils.gen.timeElapsed(seconds)) (user, system, _, _, _) = os.times() - log.info('Total CPU time taken: %s seconds.', user+system) + log.info('Total CPU time taken: %s seconds.', round(user+system, 2)) log.info('No more Irc objects, exiting.') if __name__ == '__main__': From 6fa96df6072d4e1a8df08698fbbbecc2098560b7 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 11 Apr 2015 13:33:34 -0700 Subject: [PATCH 2/2] scripts/supybot: use %.2f for rounding --- scripts/supybot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/supybot b/scripts/supybot index 03fc0daeb..05643cfee 100644 --- a/scripts/supybot +++ b/scripts/supybot @@ -132,7 +132,7 @@ def main(): seconds = now - world.startedAt log.info('Total uptime: %s.', utils.gen.timeElapsed(seconds)) (user, system, _, _, _) = os.times() - log.info('Total CPU time taken: %s seconds.', round(user+system, 2)) + log.info('Total CPU time taken: %.2f seconds.', user+system) log.info('No more Irc objects, exiting.') if __name__ == '__main__':