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


Manual Reference Pages  -  NET::ANALYSIS::TIME (3)

.ds Aq ’

NAME

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

CONTENTS

SYNOPSIS



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



DESCRIPTION

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.

new ($sec [, CW$usec] )

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.

    clone ()

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.

CLASS METHODS

    set_format ($format)

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.

    EXPORT

None by default.

AUTHOR

Adam B. Worrall, <worrall@cpan.org>

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.

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


perl v5.20.3 NET::ANALYSIS::TIME (3) 2010-03-24

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