Time2.c
1
Click here to load reader
-
Upload
karthic-rao -
Category
Education
-
view
225 -
download
0
Transcript of 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);}