summaryrefslogtreecommitdiff
path: root/benchmarks/dhrystone/files/patch-hz
blob: 5b029beed188b0318ec7c782bba0a2aeb47d1944 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
diff -Naur drystone-2.1/dhry.h drystone-patched/dhry.h
--- dhry.h	2014-08-30 16:32:37.000000000 +0200
+++ dhry.h	2014-08-30 16:37:44.933675426 +0200
@@ -385,6 +385,8 @@
 
 #include <stdio.h>
                 /* for strcpy, strcmp */
+#include <unistd.h>
+		/* for sysconf */
 
 #define Null 0 
                 /* Value of a Null pointer */
diff -Naur drystone-2.1/dhry_1.c drystone-patched/dhry_1.c
--- dhry_1.c	2014-08-30 16:32:37.000000000 +0200
+++ dhry_1.c	2014-08-30 16:44:20.484050144 +0200
@@ -262,6 +262,8 @@
                         / (float) Number_Of_Runs;
     Dhrystones_Per_Second = (float) Number_Of_Runs / (float) User_Time;
 #else
+
+    int	HZ = sysconf(_SC_CLK_TCK);
     Microseconds = (float) User_Time * Mic_secs_Per_Second 
                         / ((float) HZ * ((float) Number_Of_Runs));
     Dhrystones_Per_Second = ((float) HZ * (float) Number_Of_Runs)