[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


sleep

Delay program execution for a specified number of seconds.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <unistd.h>
unsigned int sleep(unsigned int sleep);
Parameters:

Parameters for this facility are:

sleep  
unsigned int  
The length of time in seconds  

Remarks:

The function sleep() delays execution of a program for the time indicated by the unsigned integer argument. For the Macintosh system there is no error value returned. Example of usage is given in "Example of sleep() usage."

Return:

sleep() returns zero.

Example of sleep() usage.:
#include <stdio.h>
#include <unistd.h>

int main(void) 
{
	
  
	printf("Output to window\n");
	fflush(stdout); /* needed to force output */
	
	sleep(3);
	
	printf("Second output to window");

	return 0;
}

Result
Output to window
< there is a delay now >
Second output to window


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000