3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-22 20:09:43 +01:00

Show fractional seconds; use concise duration

This commit is contained in:
Pragmatic Software 2015-05-23 06:23:37 -07:00
parent 41cc190f2a
commit afad192b83

View File

@ -4,7 +4,7 @@ use warnings;
use strict;
use Time::HiRes qw(gettimeofday);
use Time::Duration qw(duration);
use Time::Duration qw(concise duration);
use Scorekeeper;
use IRCColors;
@ -112,7 +112,11 @@ sub sort_quickeststreak {
sub print_quickeststreak {
my $player = shift @_;
return undef if $player->{lifetime_highest_quick_correct_streak} == 0;
return "$player->{nick}: $player->{lifetime_highest_quick_correct_streak} in " . duration $player->{lifetime_quickest_correct_streak};
if ($player->{lifetime_quickest_correct_streak} < 60) {
return "$player->{nick}: $player->{lifetime_highest_quick_correct_streak} in " . sprintf("%.2fs", $player->{lifetime_quickest_correct_streak});
} else {
return "$player->{nick}: $player->{lifetime_highest_quick_correct_streak} in " . concise duration $player->{lifetime_quickest_correct_streak};
}
}
sub sort_wrongstreak {