NAME
Time::Spec - a wrapper arount struct timespec
VERSION
version 0.003
SYNOPSIS
my $spec = Time::Spec->new(1.5);
my_sleeper($spec);
say $spec->to_float;
DESCRIPTION
This holds a time specification, broken down into seconds and nanoseconds. This is typically used by XS modules and not by pure-perl ones.
The object overloads numification to act like a fractional seconds when used as such.
METHODS
new($fractional)
This creates a new Time::Spec
object from a fractional amount of time.
new_from_pair($seconds, $nano_seconds)
This creates a new Time::Spec
object from the second and nano second values.
sec()
This returns the number of whole seconds.
nsec()
This returns the fractional part of the time specification in nanoseconds.
to_float()
Convert the time back into fractional seconds.
to_pair()
This returns a pair of seconds an nanoseconds of the object.
AUTHOR
Leon Timmermans <fawaka@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2025 by Leon Timmermans.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.