This class splits a given Ticks object (representing a time span) into the amount of days, hours, minutes, seconds and so on. Consequently, it takes a Ticks object as a parameter. This class can be seen as an extension to the Ticks class which provides methods to get the total number of these values. In addition, the reverse calculation can be performed, which means, the field values can be set and the corresponding time span in ticks received.
Public Fields | |
int | days |
The number of days within the time span. | |
int | hours |
The number of hours (not the total, hence 0-23) within the time span. | |
int | microseconds |
The number of microseconds (not the total, hence 0-999) within the time span. | |
int | milliseconds |
The number of milliseconds (not the total, hence 0-999) within the time span. | |
int | minutes |
The number of minutes (not the total, hence 0-59) within the time span. | |
int | nanoseconds |
The number of nanoseconds (not the total, hence 0-999) within the time span. | |
int | seconds |
The number of seconds (not the total, hence 0-59) within the time span. | |
Public Methods | |
TickSpan () | |
TickSpan (long ticks) | |
TickSpan (Ticks ticks) | |
void | clear () |
long | get () |
void | set (long ticks) |
void | set (Ticks ticks) |
Protected Fields | |
long | ticks |
The time value received from the. | |
Constructs the object using the given Tick objects ticks value. After construction, the public fields are set properly
ticks | The Ticks object to use for setting the public fields |
TickSpan | ( | long | ticks | ) |
Constructs the object using the given ticks value. After construction, the public fields are set properly
ticks | The value in ticks to use for setting the public fields |
TickSpan | ( | ) |
Constructs the object to represent a time span of 0. (Sets all public fields to 0.)
void clear | ( | ) |
Sets all public values to 0.
long get | ( | ) |
Takes the current values of the public fields and calculates a time span value in ticks. Such value can be used with class Ticks, e.g. to add or subtract time spans.
void set | ( | long | ticks | ) |
Sets the public fields to represent the given ticks value. The state of the object will hereafter be the same as it was when constructed with the same parameter.
ticks | The value in ticks to use for setting the public fields |
void set | ( | Ticks | ticks | ) |
Sets the public fields to represent the given Tick objects ticks value. The state of the object will hereafter be the same as it was when constructed with the same parameter.
ticks | The Ticks object to use for setting the public fields |