MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

Time represents a wall clock time. More...

List of all members.

Public Member Functions

  Time (int s, int us)
  Construct a Time from a number of seconds and microseconds.
  Time (timeval t)
  Construct a Time from a timeval.
  Time (struct timespec t)
  Construct a Time from a struct timespec.
int  s () const
  The number of seconds since the epoch.
int  us () const
  The number of microseconds since the last second.
Arithmetic

You can add or subtract a number of microseconds to a time to create a nearby time, or subtract to times to get the difference in microseconds.

Time  operator+ (int usecs) const
Time  operator+= (int usecs)
Time  operator- (int usecs) const
Time  operator-= (int usecs)
int  operator- (const Time &other) const
Comparison

Times can be compared using the standard operators

bool  operator< (const Time &other) const
bool  operator> (const Time &other) const
bool  operator>= (const Time &other) const
bool  operator<= (const Time &other) const
bool  operator== (const Time &other) const
bool  operator!= (const Time &other) const
Casting

Time can be cast to a timeval or struct timespec for use in syscalls.

  operator timeval ()
  operator struct timespec ()

Static Public Member Functions

static Time  now ()
  The current time.
static Time  monotonic ()
  The time since boot.

Detailed Description

Time represents a wall clock time.

Not to be used for representing a duration of time. Two times can be subtracted to return the difference between them in microseconds. A number of microseconds can be added to or subtracted from time to return a new time. Times also support all the comparison operators.


Copyright (c) 2012, Nokia Corporation and/or its subsidiary(-ies). All rights reserved. See Copyright.
MeeGo 1.2 Harmattan API