From 7beb8539de2bc6cb27e25a07fb41429f68701022 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 24 Jun 1994 17:56:23 +0000 Subject: entered into RCS --- benchmarks/forks.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'benchmarks/forks.c') 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); } -- cgit v1.2.3