/[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

Annotation of /trunk/lib/Sack.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 156 - (hide annotations)
Fri Oct 9 19:12:28 2009 UTC (14 years, 8 months ago) by dpavlin
File size: 402 byte(s)
use Sack::Color from here

1 dpavlin 135 package Sack;
2    
3 dpavlin 156 use warnings;
4     use strict;
5 dpavlin 135
6 dpavlin 156 use lib 'lib';
7     use Sack::Color;
8    
9     our $VERSION = '0.12';
10    
11 dpavlin 135 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