/[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 156 - (show annotations)
Fri Oct 9 19:12:28 2009 UTC (14 years, 7 months ago) by dpavlin
File size: 402 byte(s)
use Sack::Color from here

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

  ViewVC Help
Powered by ViewVC 1.1.26