Classes | |
class | csp::RelTimeoutGuard |
An ALT relative timeout guard, for use in an Alternative. More... | |
struct | csp::Time |
C++CSP2 uses this typedef to represent times for the purposes of timeouts and waits. More... | |
class | csp::TimeoutGuard |
An ALT absolute timeout guard, for use in an Alternative. More... | |
Functions | |
Time | csp::CurrentTime () |
Gets the current time. | |
void | csp::CurrentTime (Time *const val) |
Gets the current time. | |
csp::sign32 | csp::GetMilliSeconds (const Time &val) |
Gets the number of milliseconds (truncated) in the specified time. | |
double | csp::GetSeconds (const Time *val) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Included for compatibility with C++CSP v1.x. | |
double | csp::GetSeconds (const Time &val) |
Gets the number of seconds from the specified Time. | |
Time | csp::MicroSeconds (const long micros) |
Puts the specified integer amount of microseconds into a Time structure. | |
void | csp::MicroSeconds (const long micros, Time *const val) |
Puts the specified integer amount of microseconds into a Time structure. | |
Time | csp::MilliSeconds (const long millis) |
Puts the specified integer amount of milliseconds into a Time structure. | |
void | csp::MilliSeconds (const long millis, Time *const val) |
Puts the specified integer amount of milliseconds into a Time structure. | |
Time | csp::Seconds (const double secs) |
Puts the specified floating-point amount of seconds into a Time structure. | |
void | csp::Seconds (const double secs, Time *const val) |
Puts the specified floating-point amount of seconds into a Time structure. | |
void | csp::SleepFor (const Time &timeToSleepFor) |
Makes the current process sleep for the specified amount of time. | |
void | csp::SleepUntil (const Time &timeToSleepUntil) |
Makes the current process sleep for the specified amount of time. |
void csp::MicroSeconds | ( | const long | micros, | |
Time *const | val | |||
) |
void csp::MilliSeconds | ( | const long | millis, | |
Time *const | val | |||
) |
void csp::Seconds | ( | const double | secs, | |
Time *const | val | |||
) |
Puts the specified floating-point amount of seconds into a Time structure.
Note that this function takes a double, not an int like the other two functions. This number may be truncated/rounded during the course of the conversion into the Time structure.
secs | The (floating-point) amount of seconds | |
val | The Time structure to put the time into |
Time csp::MicroSeconds | ( | const long | micros | ) | [inline] |
Time csp::MilliSeconds | ( | const long | millis | ) | [inline] |
Time csp::Seconds | ( | const double | secs | ) | [inline] |
Puts the specified floating-point amount of seconds into a Time structure.
Note that this function takes a double, not an int like the other two functions. This number may be truncated/rounded during the course of the conversion into the Time structure.
secs | The (floating-point) amount of seconds |
double csp::GetSeconds | ( | const Time & | val | ) |
double csp::GetSeconds | ( | const Time * | val | ) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Included for compatibility with C++CSP v1.x.
sign32 csp::GetMilliSeconds | ( | const Time & | val | ) |
Gets the number of milliseconds (truncated) in the specified time.
val | A pointer to the Time |
void csp::CurrentTime | ( | Time *const | val | ) |
Gets the current time.
The value of this time may vary from operating system to operating system. It may be the number of seconds since the 1970 epoch, or it may be the number of seconds since the machine booted up. No guarantees are offered as to the relevance of its absolute value.
Instead, it should be used only for relative purposes - working out a specified time before or since now.
val | The place to put the current time |
Time csp::CurrentTime | ( | ) | [inline] |
Gets the current time.
The value of this time may vary from operating system to operating system. It may be the number of seconds since the 1970 epoch, or it may be the number of seconds since the machine booted up. No guarantees are offered as to the relevance of its absolute value.
Instead, it should be used only for relative purposes - working out a specified time before or since now.
void csp::SleepFor | ( | const Time & | timeToSleepFor | ) |
Makes the current process sleep for the specified amount of time.
There are no guarantees as to exactly how early the process will be scheduled again. In the mean-time, other processes in the thread may run (or other threads in the system) so this cannot be known exactly. However, the call will never return early - timeToSleepFor will always have elapsed.
void csp::SleepUntil | ( | const Time & | timeToSleepUntil | ) |
Makes the current process sleep for the specified amount of time.
There are no guarantees as to exactly how early the process will be scheduled again. In the mean-time, other processes in the thread may run (or other threads in the system) so this cannot be known exactly. However, the call will never return early - it will always be timeToSleepUntil or later.