Parent Directory | Revision Log
extract duration into Sack, unify versioning [0.10]
1 | dpavlin | 135 | package Sack; |
2 | |||
3 | our $VERSION = '0.10'; | ||
4 | |||
5 | use Exporter 'import'; | ||
6 | our @EXPORT = qw(duration); | ||
7 | |||
8 | our $t = time; | ||
9 | our $log_fh; | ||
10 | |||
11 | sub duration { | ||
12 | my $now = time; | ||
13 | my $d = $now - $t; | ||
14 | my $message = sprintf "%.4fs %s\n", $d, join(' ',@_); | ||
15 | print $message; | ||
16 | open( $log_fh, '>', '/tmp/sack.log' ) unless $log_fh; | ||
17 | print $log_fh $message; | ||
18 | $t = $now; | ||
19 | } | ||
20 | |||
21 | 1; |
ViewVC Help | |
Powered by ViewVC 1.1.26 |