Name

SPVM::Sys::Time::Timespec - struct timespec in the C language

Description

Sys::Time::Timespec class in SPVM represents struct timespec in the C language.

Usage

use Sys::Time::Timespec;

my $ts = Sys::Time::Timespec->new;

my $ts = Sys::Time::Timespec->new(5, 300_000_000);

my $ts_sec = $ts->tv_sec;
$ts->set_tv_sec(12);

my $ts_nsec = $ts->tv_nsec;
$ts->set_tv_nsec(34);

Class Methods

new

static method new : Sys::Time::Timespec ($tv_sec : long = 0, $tv_nsec : long = 0);

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

Instance Methods

DESTROY

native method DESTROY : void ();

The destructor.

tv_sec

method tv_sec : long ()

Returns tv_sec.

set_tv_sec

method set_tv_sec : void ($ts_sec : long);

Sets tv_sec.

tv_nsec

method tv_nsec : long ()

Returns tv_nsec.

set_tv_nsec

method set_tv_nsec : void ($ts_nsec : long);

Sets tv_nsec.

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License