TimeVal

Represents a precise time, with seconds and microseconds. Similar to the struct timeval returned by the gettimeofday() UNIX system call.

GLib is attempting to unify around the use of 64-bit integers to represent microsecond-precision time. As such, this type will be removed from a future version of GLib. A consequence of using glong for tv_sec is that on 32-bit systems GTimeVal is subject to the year 2038 problem.

More...

Constructors

this
this(GTimeVal* gTimeVal, bool ownedRef)

Sets our main struct and passes it to the parent class.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

add
void add(glong microseconds)

Adds the given number of microseconds to time_. microseconds can also be negative to decrease the value of time_.

getStruct
void* getStruct()

the main Gtk struct as a void*

getTimeValStruct
GTimeVal* getTimeValStruct(bool transferOwnership)

Get the main Gtk struct

toIso8601
string toIso8601()

Converts time_ into an RFC 3339 encoded string, relative to the Coordinated Universal Time (UTC). This is one of the many formats allowed by ISO 8601.

Properties

tvSec
glong tvSec [@property getter]
glong tvSec [@property setter]

seconds

tvUsec
glong tvUsec [@property getter]
glong tvUsec [@property setter]

microseconds

Static functions

fromIso8601
bool fromIso8601(string isoDate, TimeVal time)

Converts a string containing an ISO 8601 encoded date and time to a glib.TimeVal and puts it into time_.

getCurrentTime
void getCurrentTime(TimeVal result)

Equivalent to the UNIX gettimeofday() function, but portable.

getMonotonicTime
long getMonotonicTime()

Queries the system monotonic time.

getRealTime
long getRealTime()

Queries the system wall-clock time.

usleep
void usleep(gulong microseconds)

Pauses the current thread for the given number of microseconds.

Variables

gTimeVal
GTimeVal* gTimeVal;

the main Gtk struct

Detailed Description

Deprecated: Use gstreamer.DateTime or guint64 instead.