Guest User

Untitled

a guest
May 27th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. int main(int argc, char** argv) {
  2. int i;
  3. for (i = 0; i < 1000; ++i) {
  4. FILE *fp = fopen(argv[1], "rce");
  5. while (! feof_unlocked (fp)) {
  6. char line[1024];
  7. fgets(line, sizeof(line), fp);
  8. }
  9. fclose(fp);
  10. }
  11.  
  12. return 0;
  13. }
  14.  
  15.  
  16. $ g++ -o test test.c -O2 -lpthread
  17. $ time ./test /proc/27181/maps
  18.  
  19. real 0m0.305s
  20. user 0m0.032s
  21. sys 0m0.273s
Advertisement
Add Comment
Please, Sign In to add comment