/[Sack]/trunk/lib/Sack.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/lib/Sack.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 185 - (show annotations)
Sun Nov 8 13:18:04 2009 UTC (14 years, 6 months ago) by dpavlin
File size: 429 byte(s)
use Time::HiRes for duration

1 package Sack;
2
3 use warnings;
4 use strict;
5
6 use Time::HiRes qw(time);
7
8 use lib 'lib';
9 use Sack::Color;
10
11 our $VERSION = '0.12';
12
13 use Exporter 'import';
14 our @EXPORT = qw(duration);
15
16 our $t = time;
17 our $log_fh;
18
19 sub duration {
20 my $now = time;
21 my $d = $now - $t;
22 my $message = sprintf "%.4fs %s\n", $d, join(' ',@_);
23 print $message;
24 open( $log_fh, '>', '/tmp/sack.log' ) unless $log_fh;
25 print $log_fh $message;
26 $t = $now;
27 }
28
29 1;

  ViewVC Help
Powered by ViewVC 1.1.26