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@2d5e936f0d)
This commit is contained in:
James Lu 2015-02-27 19:36:45 -08:00
parent 3275806740
commit fc418d35b0

View File

@ -132,7 +132,7 @@ def main():
seconds = now - world.startedAt seconds = now - world.startedAt
log.info('Total uptime: %s.', utils.gen.timeElapsed(seconds)) log.info('Total uptime: %s.', utils.gen.timeElapsed(seconds))
(user, system, _, _, _) = os.times() (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.') log.info('No more Irc objects, exiting.')
if __name__ == '__main__': if __name__ == '__main__':