Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2012
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include <unistd.h>
  2. #include <stdio.h>
  3.  
  4. void fast() {
  5.   int i;
  6.   for (i = 0; i < 2000; i++)
  7.     printf("Doing some fast work %d\n", i);
  8. }
  9.  
  10. void slow() {
  11.   printf("Doing some slow non-CPU-bound work\n");
  12.   sleep(3);
  13. }
  14.  
  15. int main() {
  16.   fast();
  17.   slow();
  18.   fast();
  19.  
  20.   return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement