Name

SPVM::Sys::Time::Timeval - struct timeval in C language

Usage

use Sys::Time::Timeval;

my $tv = Sys::Time::Timeval->new;

my $tv_sec = $tv->tv_sec;
$tv->set_tv_sec(12);

my $tv_usec = $tv->tv_usec;
$tv->set_tv_usec(34);

Description

Sys::Time::Timeval represents struct timeval in C language.

See gettimeofday(2) - Linux man page about struct timeval in Linux.

Class Methods

new

static method new : Sys::Time::Timeval ()

Creates a new Sys::Time::Timeval object.

my $tv = Sys::Time::Timeval->new;

Instance Methods

tv_sec

method tv_sec : long ()

Gets tv_sec.

my $tv_sec = $tv->tv_sec;

set_tv_sec

method set_tv_sec : void ($tv_sec : long)

Sets tv_sec.

$tv->set_tv_sec(12);

tv_usec

method tv_usec : long ()

Gets tv_usec.

my $tv_usec = $tv->tv_usec;

set_tv_usec

method set_tv_usec : void ($tv_usec : long)

Sets tv_usec.

$tv->set_tv_usec(34);