Skip to content

Commit

Permalink
prefix: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
XPhyro committed Sep 16, 2024
1 parent 4aa1671 commit a9cd8cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cpp/util/core/prefix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,29 +83,29 @@ int main(int argc, char* argv[])
if (options.prefix_time()) {
auto elapsed_time = current_time - start_time;
auto elapsed_ticks = elapsed_time.count();
auto elapsed_human_ticks = xph::unit::tick_to_human(elapsed_ticks);

if (prefixed)
std::cout << " | ";
else
std::cout << '[';

std::cout << '@' << elapsed_human_ticks;
std::cout << '@';
xph::unit::write_tick_as_human(std::cout, elapsed_ticks);

prefixed = true;
}

if (options.prefix_delta()) {
auto differential_time = current_time - last_time;
auto differential_ticks = differential_time.count();
auto differential_human_ticks = xph::unit::tick_to_human(differential_ticks);

if (prefixed)
std::cout << " | ";
else
std::cout << '[';

std::cout << '+' << differential_human_ticks;
std::cout << '+';
xph::unit::write_tick_as_human(std::cout, differential_ticks);

prefixed = true;
}
Expand Down

0 comments on commit a9cd8cb

Please sign in to comment.