The QTime class provides time functions 24 hours a day. (details) (complete member list)
#include <qdatetm.h>
The time resolution of QTime is a millisecond, although the accuracy depends on the underlying operating system. Some operating systems (e.g. Linux) support a one-millisecond resolution, while others (i.e. MS-DOS and Windows) support only a 55 millisecond resolution.
Constructs a null time 00:00:00.000. Null times are valid.
Constructs a time with hour h, minute m, seconds s and milliseconds ms.
Returns the time plus ms milliseconds.
Returns the time plus nsecs seconds.
Returns the current time.
Returns the number of microseconds that have elapsed since start() or restart() were called.
Returns the hour part (0..23) of the time.
Returns TRUE if the time is valid, or FALSE if the time is invalid or null. The time 23:30:55.746 is valid, while 24:12:30 is invalid.
Returns TRUE if the specified time is valid.
Returns the minute part (0..59) of the time.
Returns the millisecond part (0..999) of the time.
Returns the number of milliseconds between this time and t.
Restarts for timing, and returns the number of microseconds that have elapsed since start() or restart().
Returns the second part (0..59) of the time.
Returns the number of seconds between this time and t.
Sets the hour h, minute m, seconds s and milliseconds ms. Returns TRUE if the time is valid, FALSE if it is invalid.
Sets the time to the current time, e.g. for timing:
QTime t;
t.start(); // start clock
... // some lengthy task
printf( "%d\n", t.elapsed() ); // prints # msecs elapsed
See also: restart(), elapsed().
Converts the date to a string, which is returned. Milliseconds are not included. The string format is "03:40:13".
Writes the time t to the stream s and returns a reference to s.
Reads the time t from the stream s and returns a reference to s.
This file is part of the Qt toolkit, copyright 1995 Troll Tech, all rights reserved.
It was generated from the following files: