summaryrefslogtreecommitdiffhomepage
path: root/misc/benchmarks/various/prng_bench.cpp
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-03-30 17:59:08 +0200
committerTyge Løvset <[email protected]>2023-03-30 17:59:08 +0200
commita0a290645828c88597efce80f6b0f5a958cefa89 (patch)
tree53dc78071653b515a06a60baf4488a1b6d080b32 /misc/benchmarks/various/prng_bench.cpp
parent32df5677c9906661e91aad294e45a258e2eaab18 (diff)
downloadSTC-modified-a0a290645828c88597efce80f6b0f5a958cefa89.tar.gz
STC-modified-a0a290645828c88597efce80f6b0f5a958cefa89.zip
Added crand.h - Alternative API to crandom.h, which will be deprecated.
Diffstat (limited to 'misc/benchmarks/various/prng_bench.cpp')
-rw-r--r--misc/benchmarks/various/prng_bench.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/benchmarks/various/prng_bench.cpp b/misc/benchmarks/various/prng_bench.cpp
index be07f799..234e3805 100644
--- a/misc/benchmarks/various/prng_bench.cpp
+++ b/misc/benchmarks/various/prng_bench.cpp
@@ -2,7 +2,7 @@
#include <iostream>
#include <ctime>
#include <random>
-#include <stc/crandom.h>
+#include <stc/crand.h>
static inline uint64_t rotl64(const uint64_t x, const int k)
{ return (x << k) | (x >> (64 - k)); }
@@ -124,7 +124,7 @@ int main(void)
{
enum {N = 500000000};
uint16_t* recipient = new uint16_t[N];
- static stc64_t rng;
+ static crand_t rng;
init_state(rng.state, 12345123);
std::mt19937 mt(12345123);
@@ -187,7 +187,7 @@ int main(void)
beg = clock();
for (size_t i = 0; i < N; i++)
- recipient[i] = stc64_rand(&rng);
+ recipient[i] = crand_u64(&rng);
end = clock();
cout << "stc64:\t\t"
<< (float(end - beg) / CLOCKS_PER_SEC)