|
| QString | asString () const |
| | Converts the time-stamp to a string. More... |
| |
| int64_t | days () const |
| | Returns the number of complete days this timestamp spans. More... |
| |
| double | daysD () const |
| | Returns the number of days (including fractions of a day) this timestamp spans. More... |
| |
| int64_t | fractions () const |
| | Returns the fractions of second that this timestamp includes, in range 0-2^24. More... |
| |
| int64_t | hours () const |
| | Returns the number of complete hours this timestamp spans. More... |
| |
| int64_t | milliseconds () const |
| | Returns the number of full milliseconds that this time-stamp includes. More... |
| |
| int64_t | minutes () const |
| | Returns the number of complete hours this timestamp spans. More... |
| |
| int64_t | seconds () const |
| | Returns the number of full seconds that this time-stamp includes. More... |
| |
| double | secondsD () const |
| | Returns the number of seconds in this time-stamp, as floating point number. More... |
| |
| double | secsTo (const TimeStamp &that) const |
| | Returns the number of seconds to the argument time-stamp. More... |
| |
| template<typename T > |
| void | setSeconds (T s) |
| | Sets the timestamp to s seconds. More... |
| |
| void | setValue (type val) |
| | Sets the current native timestamp value. More... |
| |
| TimeStamp | since () const |
| | Returns the amount of time passed since this timestamp. More... |
| |
| double | sinceSecondsD () const |
| | Returns the number of seconds passed since this timestamp. More... |
| |
| double | subSecondsD () const |
| | Returns the fraction of a second in this time-stamp, in range 0.0-1.0. More... |
| |
| double | subSecondsUS () const |
| | Returns the fraction part of a second in microseconds (in range 0.0-1000000.0) More... |
| |
|
| TimeStamp () |
| | Constructs a timestamp dated to 1.1.1970. |
| |
| | TimeStamp (type val) |
| | Construct timestamp with the given time internal representation. More... |
| |
| double | usecsTo (const TimeStamp &that) const |
| | Returns the number of micro-seconds to the argument time-stamp. More... |
| |
| type & | value () |
| | Returns a reference to the current timestamp native value. More... |
| |
| type | value () const |
| | Returns the current timestamp native value. More... |
| |
|
| static TimeStamp | createDate (const char *date, const char *delim="-", bool yearfirst=true) |
| | Creates a timestamp from date string. More... |
| |
| static TimeStamp | createDateTime (const char *date, const char *delim, bool yearfirst, const char *time, const char *timedelim) |
| | Creates a timestamp from date and time string. More... |
| |
| template<typename T > |
| static TimeStamp | createDays (T days) |
| | Create a time-stamp with a given number of days. More... |
| |
| static TimeStamp | createDHMS (int days, int hours, int minutes, int seconds) |
| | Creates a time-stamp consisting of days, hours, minutes, and seconds. More... |
| |
| template<typename T > |
| static TimeStamp | createHours (T hours) |
| | Create a time-stamp with a given number of hours. More... |
| |
| template<class T > |
| static TimeStamp | createMilliSeconds (T s, typename std::enable_if< std::is_integral< T >::value >::type *=0) |
| | Create a TimeStamp with the given number of milliseconds. More... |
| |
| template<class T > |
| static TimeStamp | createMilliSeconds (T s, typename std::enable_if< std::is_floating_point< T >::value >::type *=0) |
| | Create a TimeStamp with the given number of milliseconds. More... |
| |
| template<typename T > |
| static TimeStamp | createMinutes (T s) |
| | Create a TimeStamp with the given number of minutes. More... |
| |
| template<class T > |
| static TimeStamp | createSeconds (T s, typename std::enable_if< std::is_integral< T >::value >::type *=0) |
| | Create a TimeStamp with the given number of seconds. More... |
| |
| template<class T > |
| static TimeStamp | createSeconds (T s, typename std::enable_if< std::is_floating_point< T >::value >::type *=0) |
| | Create a TimeStamp with the given number of seconds. More... |
| |
| static TimeStamp | createTime (const char *time, const char *delim=":") |
| | Creates a timestamp from time string. More... |
| |
| static TimeStamp | currentTime () |
| | Returns the current time value, by looking at the wall clock. More... |
| |
| static TimeStamp | ticksPerDay () |
| | The number of ticks that take place during one day. More... |
| |
| static TimeStamp | ticksPerHour () |
| | The number of ticks that take place during one hour. More... |
| |
| static TimeStamp | ticksPerMinute () |
| | The number of ticks that take place during one minute. More... |
| |
| static TimeStamp | ticksPerSecond () |
| | The number of ticks that take place during one second. More... |
| |
A high-resolution time-stamp object.
A time-stamp has 40 bits for the seconds and 24 bits for fractions of a second. The seconds are as they come from the UNIX clock: 1.1.1970 the counter was zero.
Thus there are 2^24 (16777216) ticks in a second, which works as the basic timing unit. This gives about 16.78 ticks per microsecond, which is good enough to do highly accurate timing with any reasonable media source. At the same time the 40-bit second field is sufficient to store all dates within the current century, and a few forward/backward. The time value is internally stored in a signed 64-bit integer. In most applications time-stamps could be unsigned, but this leads easily to annoying bugs if the unsignedness is not taken into account in various time computations.
TimeStamps can be easily casted to/from integer types.
This design is basically copy of the OSC timing system.
- Examples:
- PostProcessingExample.cpp.