I was interested to know the difference between puts () and printf () when using the sleep () function.
Here is my code (in C language):
printf("hello, world");
sleep(1);
printf("Good, bye!");
After compiling and running the program, it seems that she will first sleep , and then type "hello, worldGood, bye!"
However, if puts () is used instead of printf (), it will print "hello, world" and then sleep and finally print "Good, bye".
puts("hello, world");
sleep(1);
puts("Good, bye!);
source
share