TutSleep


Name

TutSleep — suspend execution for specified interval

Synopsis

T_BOOL TutSleep(interval) 
T_REAL8 interval; 

Arguments

interval — number of seconds to pause

Return Values

TRUE if process slept for full interval, FALSE otherwise.

Diagnostics

If TutSleep fails, it returns FALSE and sets the global SmartSockets error number to one of:

Description

TutSleep is a convenience function that causes the process to sleep for the specified interval (fractional seconds are legal). TutSleep is roughly equivalent to the UNIX usleep function. TutSleep can be used instead of usleep for portability reasons.

Caution

TutSleep is implemented with the function select, which may return prematurely if it receives a signal. Therefore TutSleep may sometimes return early (TutSleep returns FALSE in this case). This is normally not a problem.

See Also

None

Examples

This example suspends a process for 3.45 seconds:

if (!TutSleep(3.45)) { 
  /* error */ 
}  

TIBCO SmartSockets™ Utilities
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com