s/ich_arg/ich_desc/
[dragonfly.git] / test / sysperf / loop2.c
blobada6b823d3a24a52bcb4f961e3cf08adc30132d7
1 /*
2 * loop2.c
4 * Used as a helper to test AST delivery. Loops in user mode for a few
5 * seconds. This one forks and runs the loop in two processes.
7 * $DragonFly: src/test/sysperf/loop2.c,v 1.1 2003/08/12 02:29:44 dillon Exp $
8 */
10 #include "blib.h"
12 #define LOOP 100000000
14 static void nop() { }
16 int
17 main(int ac, char **av)
19 int i;
20 pid_t pid;
22 printf("SMP contention, userland-only loop, duel-forks. Run just one\n");
24 start_timing();
25 if (fork() == 0) {
26 for (i = 0; i < LOOP; ++i)
27 nop();
28 _exit(1);
29 } else {
30 for (i = 0; i < LOOP; ++i)
31 nop();
32 while (wait(NULL) > 0);
33 stop_timing(LOOP, "loop2/2xfork");
35 return(0);