Factorisation.

This commit is contained in:
Patrick Pelissier committed 2017-07-08 15:14:01 +02:00
1 parent f8ff180b94
commit 30484f4291
7 files changed
+37 -186

No files matched your search

+1 -31
View File
@@ -17,37 +17,7 @@
using namespace std;
unsigned long g_result;
static unsigned long long
cputime (void)
{
struct rusage rus;
getrusage (0, &rus);
return rus.ru_utime.tv_sec * 1000000ULL + rus.ru_utime.tv_usec;
}
static unsigned int randValue = 0;
static void rand_init(void)
{
randValue = 0;
}
static unsigned int rand_get(void)
{
randValue = randValue * 31421U + 6927U;
return randValue;
}
static void test_function(const char str[], size_t n, void (*func)(size_t))
{
unsigned long long start, end;
// (*func)(n);
start = cputime();
(*func)(n);
end = cputime();
end = (end - start) / 1000U;
printf ("%s %Lu ms for n = %lu\n", str, end, n);
}
#include "common.h"
/********************************************************************************************/