SHARE
TWEET

Untitled

a guest Aug 2nd, 2012 37 Never
  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. }
RAW Paste Data
Top