Manual Reference Pages - NET::ANALYSIS::TIME (3)
Net::Analysis::Time - value object for [tv_sec, tv_usec] times
my $t1 = Net::Analysis::Time->new(10812345, 123456);
my $t2 = Net::Analysis::Time->new(10812356, 123456);
my $diff = $t2-$t1; # == new Time Object
print "$diff\n"; # == "11.000000"
$t1->round_usec(10000); # "$t1" == "10812345.120000";
Cant believe Ive found myself implementing a date/time module. The shame of
This is a heavily overloaded object, so +, - do what you expect.
There is some format stuff to change how it stringfies, and some stuff for
rounding off values, used elsewhere for time-boxing.
This stuff should probably all be junked as soon as someone wants some
new ($sec [, CW$usec] )
If passed a single floating point arg, does what it can, but dont blame me if
rounding errors knacker things up.
Best to pass two ints, one seconds and one microseconds.
Returns a new object, holding the same time value as the invocant.
round_usec ($usec_step [, CW$round_up_not_down])
Rounds the time down to the nearest usec_step value. Valid values between 10
and 1000000. A value of 1000000 will round to the nearest second.
Optional argument, if true, causes rounding to go up, not down.
Set the default output format for stringification of the date/time.
The parameter is either a strftime(3) compliant string, or a named
raw - 1100257189.123456
time - 10:59:49.123456
full - 2004/11/12 10:59:49.123456
Returns the old format.
None by default.
Adam B. Worrall, <email@example.com>
COPYRIGHT AND LICENSE
Copyright (C) 2004 by Adam B. Worrall
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.5 or,
at your option, any later version of Perl 5 you may have available.
|perl v5.20.3 ||NET::ANALYSIS::TIME (3) ||2010-03-24 |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.