time2.c

1

Click here to load reader

Upload: karthic-rao

Post on 23-Jan-2018

225 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Time2.c

/* Hackintosh Rao , Codes for GNU/LINUX \m/ *//*system calls used :sleep(int sec) *//*Sleep system call pauses the execution of instructions for specified no.of.seconds*/#include<stdio.h>#include<unistd.h>#include<stdlib.h>#include<time.h>int main(){ int i; for(i=0;i<10;i++) printf("\n\t\tWithout time delay"); sleep(2); printf("\nWait and watch how the execution halts for 2 seconds each time when SLEEP is called"); sleep(2); printf("\nLOADING"); for(i=0;i<10;i++) { printf("\n# "); sleep(2) ;/*the argument for sleep system call is an integer duration in sec for which you want the exection of the instructions to be put to pause */

} exit(0);}