linux sleep with exec /bin/sleep
sleep .5 # Waits 0.5 second.
sleep 5 # Waits 5 seconds.
sleep 5s # Waits 5 seconds.
sleep 5m # Waits 5 minutes.
sleep 5h # Waits 5 hours.
sleep 5d # Waits 5 days.int pid= fork();
if (pid==0) { // child
execl("/bin/sleep", "sleep", argv[1], NULL); // argv[1] is the sleeptime
perror("execl");
return EXIT_FAILURE;
}
if (waitpid(pid,NULL,0)<0) {
perror("waitpid");
return EXIT_FAILURE;
}
Also in C:
- code: 'EADDRINUSE', [0] errno: 'EADDRINUSE', [0] syscall: 'listen', [0] address: '::', [0] port: 5000
- how make a character in c scanf
- int to float c
- XAudio2 C
- error: expected declaration or statement at end of input
- setup eslint vscode local project
- Search Code Snippets
- sidebar materializecss
- c allocate array
- 233 pounds to inr
- functions in c
- slurm array job
- c printf right pad with space
- porhub
- sinus c math.h
- c check if array is empty
- insertion singly linked list in c
- how to create an array of char in c++
- get current used proxy windows 7
- allocate memory c
- read a document in c getting name from console
- write array of char to file in c
- how to check where the last char is in a string c
- how to input a string into a char array cpp