summaryrefslogtreecommitdiffhomepage
path: root/misc/benchmarks/plotbench/cpque_benchmark.cpp
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-08 16:16:49 +0100
committerTyge Løvset <[email protected]>2023-02-08 17:18:24 +0100
commitc4441f5fc665194fbd7a894a67a64a08c3beac42 (patch)
tree82f231b6e8fcb75625166f98aa785baaa265a3d6 /misc/benchmarks/plotbench/cpque_benchmark.cpp
parent673dd5319a488d4b702b94dd9aeda4e497ae4fbc (diff)
downloadSTC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.tar.gz
STC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.zip
Changed to use lowercase flow-control macros in examples (uppercase will still be supported). Improved many examples to use c_make() to init containers.
Diffstat (limited to 'misc/benchmarks/plotbench/cpque_benchmark.cpp')
-rw-r--r--misc/benchmarks/plotbench/cpque_benchmark.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/misc/benchmarks/plotbench/cpque_benchmark.cpp b/misc/benchmarks/plotbench/cpque_benchmark.cpp
index f2a85aee..a729c09f 100644
--- a/misc/benchmarks/plotbench/cpque_benchmark.cpp
+++ b/misc/benchmarks/plotbench/cpque_benchmark.cpp
@@ -20,14 +20,14 @@ void std_test()
std::priority_queue<float, std::vector<float>, std::greater<float>> pq;
rng = stc64_new(seed);
clock_t start = clock();
- c_FORRANGE (i, N)
+ c_forrange (i, N)
pq.push((float) stc64_randf(&rng)*100000);
printf("Built priority queue: %f secs\n", (clock() - start) / (float) CLOCKS_PER_SEC);
printf("%g ", pq.top());
start = clock();
- c_FORRANGE (i, N) {
+ c_forrange (i, N) {
pq.pop();
}
@@ -40,22 +40,22 @@ void stc_test()
stc64_t rng;
int N = 10000000, M = 10;
- c_AUTO (cpque_f, pq)
+ c_auto (cpque_f, pq)
{
rng = stc64_new(seed);
clock_t start = clock();
- c_FORRANGE (i, N)
+ c_forrange (i, N)
cpque_f_push(&pq, (float) stc64_randf(&rng)*100000);
printf("Built priority queue: %f secs\n", (clock() - start) / (float) CLOCKS_PER_SEC);
printf("%g ", *cpque_f_top(&pq));
- c_FORRANGE (i, M) {
+ c_forrange (i, M) {
cpque_f_pop(&pq);
}
start = clock();
- c_FORRANGE (i, M, N)
+ c_forrange (i, M, N)
cpque_f_pop(&pq);
printf("\npopped PQ: %f secs\n", (clock() - start) / (float) CLOCKS_PER_SEC);
}