summaryrefslogtreecommitdiff
path: root/numsort.c
diff options
context:
space:
mode:
Diffstat (limited to 'numsort.c')
-rw-r--r--numsort.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/numsort.c b/numsort.c
index b9765cf..e05c742 100644
--- a/numsort.c
+++ b/numsort.c
@@ -6,7 +6,7 @@
#include <limits.h>
#include <time.h>
-#include "nmglobal.h"
+#include "cleanbench.h"
#include "randnum.h"
@@ -28,6 +28,8 @@ static void LoadNumArrayWithRand(long *array, unsigned int num_arrays);
static inline void NumHeapSort(long *array, unsigned long bottom, unsigned long top);
static inline void NumSift(long *array, unsigned long min, unsigned long max);
+static double results;
+
/**************
** DoNumSort **
***************
@@ -38,7 +40,6 @@ void
DoNumSort (void)
{
const char* context = "CPU:Numeric Sort";
- SortStruct* numsortstruct = &global_numsortstruct;
long* array = NULL;
clock_t total_time = 0;
int iterations = 0;
@@ -93,7 +94,7 @@ DoNumSort (void)
free(array);
- numsortstruct->results = (double)(iterations * num_arrays * CLOCKS_PER_SEC) / (double)total_time;
+ results = (double)(iterations * num_arrays * CLOCKS_PER_SEC) / (double)total_time;
}
/***********************
@@ -219,3 +220,9 @@ NumSift(long *array, unsigned long min, unsigned long max)
}
}
}
+
+inline double
+getNumSortScore(void)
+{
+ return results;
+}