2#include "../foray_basics.hpp"
10 static inline const char*
BEGIN =
"Begin";
11 static inline const char*
END =
"End";
14 const char*
Id =
"no Id";
35 std::string
PrintCsvLine(
char separator =
';',
bool includeNewLine =
true)
const;
37 std::string
PrintCsvHeader(
char separator =
';',
bool includeNewLine =
true)
const;
59 std::vector<BenchmarkLog>
mLogs;
Base class for all benchmark types.
Definition foray_benchmarkbase.hpp:44
BenchmarkLog mCurrentLog
Definition foray_benchmarkbase.hpp:60
void Begin(fp64_t timestamp)
Begins a new benchmark and records the "Begin" timestamp.
std::vector< BenchmarkLog > mLogs
Definition foray_benchmarkbase.hpp:59
void LogTimestamp(const char *id, fp64_t timestamp)
Logs timestamp of id.
void End(fp64_t timestamp)
Records the "End" timestamp and finalizes the benchmark.
bool mRecording
Definition foray_benchmarkbase.hpp:61
Log of a single benchmark run. All timestamps given must be relative to the same base time.
Definition foray_benchmarkbase.hpp:21
std::vector< fp64_t > Deltas
Deltas between the timestamps in milliseconds.
Definition foray_benchmarkbase.hpp:30
void PrintImGui(bool omitTimestamps=true)
Execute imgui command sequence to display the benchmark results.
std::string PrintCsvLine(char separator=';', bool includeNewLine=true) const
Prints all timestamps, separated by the separator character.
fp64_t End
Value of the last recorded timestamp.
Definition foray_benchmarkbase.hpp:26
fp64_t Begin
Value of the first recorded timestamp.
Definition foray_benchmarkbase.hpp:24
std::string PrintPretty(bool omitTimestamps=true) const
Prints a table with all timestamps and deltas, aswell as a total delta.
std::vector< BenchmarkTimestamp > Timestamps
List of timestamps in chronological order. Guaranteed to begin with BenchmarkTimestamp::Begin and end...
Definition foray_benchmarkbase.hpp:28
std::string PrintCsvHeader(char separator=';', bool includeNewLine=true) const
Prints all timestamps, separated by the separator character.
Timestamp combining a label / id with a timestamp in milliseconds.
Definition foray_benchmarkbase.hpp:8
static const char * BEGIN
Definition foray_benchmarkbase.hpp:10
fp64_t Timestamp
Timestamp in milliseconds.
Definition foray_benchmarkbase.hpp:16
static const char * END
Definition foray_benchmarkbase.hpp:11
const char * Id
Id of the data point for identification.
Definition foray_benchmarkbase.hpp:14
#define FORAY_GETTER_CR(member)
Return constant reference.
Definition foray_basics.hpp:60
#define FORAY_GETTER_MR(member)
Return mutable reference.
Definition foray_basics.hpp:54
Definition foray_bench_declares.hpp:3
double fp64_t
stdint.h style 64 bit floating point type alias (double)
Definition foray_basics.hpp:15