summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/Makefile7
-rw-r--r--benchmarks/forks.c5
2 files changed, 7 insertions, 5 deletions
diff --git a/benchmarks/Makefile b/benchmarks/Makefile
index 7755267e..9c105d7a 100644
--- a/benchmarks/Makefile
+++ b/benchmarks/Makefile
@@ -18,15 +18,12 @@
dir := benchmarks
include ../Makeconf
+CCTARGET=i386-gnu
-DIST_FILES =
+DIST_FILES = forks.c
all: forks
-OBJS=forks.o
-
-forks: $(OBJS) $(libc); $(link)
-
install: $(hurdroot) forks
$(INSTALL_BIN) forks $(hurdroot)/bin/forks
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);
}