Skip to content

Commit 887706c

Browse files
committed
GameEngine.h: Using a local tic/toc timer variable for benchmarking to avoid interference with applications using the global timer variable from Core/Benchmark.h.
1 parent 08a279f commit 887706c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/Termin8or/sys/GameEngine.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ namespace t8x
111111
double real_time_s = 0.;
112112
double real_last_time_s = 0.;
113113
double real_dt_s = 0.;
114+
benchmark::TicTocTimer tictoc_game_engine;
114115

115116
struct AnimCtrData
116117
{
@@ -317,7 +318,7 @@ namespace t8x
317318
t8x::setup_logging(m_params.log_mode, get_exe_folder(), m_params.xcode_log_path, m_params.log_filename, curr_rnd_seed);
318319

319320
if (m_params.enable_benchmark)
320-
benchmark::tic();
321+
benchmark::tic(tictoc_game_engine);
321322

322323
if (time_inited.once())
323324
real_start_time_s = std::chrono::steady_clock::now();
@@ -366,7 +367,7 @@ namespace t8x
366367
{
367368
float dur_s = 0.f;
368369
if (m_params.enable_benchmark)
369-
dur_s = 1e-3f * benchmark::toc();
370+
dur_s = 1e-3f * benchmark::toc(tictoc_game_engine);
370371

371372
end_screen(sh);
372373

0 commit comments

Comments
 (0)