#include #include char *argv[] = {"nop", 0}; void main(void) { int i, n; uvlong t0, t1; n = 10000; t0 = nsec(); for(i = 0; i < n; i++) switch(fork()){ case 0: exec(*argv, argv); _exits("exec"); case -1: sysfatal("fork"); default: free(wait()); } t1 = nsec(); print("%g\n", 1.*(t1 - t0)/(1.*n)); exits(""); }