summaryrefslogtreecommitdiff
path: root/benchmarks/forks.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-06-24 17:56:23 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-06-24 17:56:23 +0000
commit7beb8539de2bc6cb27e25a07fb41429f68701022 (patch)
tree92ec5440659fe847bb740ccfb78d16cf65332153 /benchmarks/forks.c
parent35fdf83b04895b7012578e358f00a4a5c9a681eb (diff)
entered into RCS
Diffstat (limited to 'benchmarks/forks.c')
-rw-r--r--benchmarks/forks.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/benchmarks/forks.c b/benchmarks/forks.c
index ae9efaab..2bb98a88 100644
--- a/benchmarks/forks.c
+++ b/benchmarks/forks.c
@@ -14,6 +14,7 @@ main(argc, argv)
register int nforks, i;
char *cp;
int pid, child, status, brksize;
+ int starttime, endtime;
if (argc < 2) {
printf("usage: %s number-of-forks sbrk-size\n", argv[0]);
@@ -29,6 +30,8 @@ main(argc, argv)
printf("%s: bad size to sbrk\n", argv[2]);
exit(3);
}
+
+ time (&starttime);
cp = (char *)sbrk(brksize);
if ((int)cp == -1) {
perror("sbrk");
@@ -47,5 +50,7 @@ main(argc, argv)
while ((pid = wait(&status)) != -1 && pid != child)
;
}
+ time (&endtime);
+ printf ("Time: %d seconds.\n", endtime - starttime);
exit(0);
}