Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ca-bench.H File Reference

Tiny chrono-based timer used by the CA module Examples. More...

#include <chrono>
#include <cstddef>
#include <cstdio>
#include <utility>
Include dependency graph for ca-bench.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Aleph::CA::Bench_Timer
 Tiny start/stop wall-clock timer. More...
 

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 
namespace  Aleph::CA
 

Functions

template<typename F >
double Aleph::CA::bench_seconds (F &&f)
 Run f() once and return the wall-clock time it took, in seconds.
 
const char * Aleph::CA::format_throughput (double cells_per_second)
 Format a "cells per second" rate as "X.XX M cells/s".
 

Detailed Description

Tiny chrono-based timer used by the CA module Examples.

This header is intentionally minimal: it lives in the public headers layout so the Examples can include it the same way as the rest of the library, but it is not part of the engine API. It is only used by the Phase-5 microbenchmarks that need a deterministic wall-clock reading (e.g. Examples/ca_bench_example.cc).

Public surface:

  • Bench_Timer — start/stop wall-clock timer.
  • bench_seconds(F) — measure the wall time of one invocation.
  • format_throughput — pretty-print "M cells / s" numbers.

Everything is inline and depends only on <chrono> and <cstdio>, so it does not pull anything else from Aleph-w into the Examples build graph.

Author
Leandro Rabindranath Leon

Definition in file ca-bench.H.