GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::Analysis::Time(3) User Contributed Perl Documentation Net::Analysis::Time(3)

Net::Analysis::Time - value object for [tv_sec, tv_usec] times

  use Net::Analysis::Time;

  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";

Can't believe I've found myself implementing a date/time module. The shame of it.

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 efficiency.

If passed a single floating point arg, does what it can, but don't 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.

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 format:

  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, <worrall@cpan.org>

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.

2010-03-24 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.