Skip to content
  • David Frank's avatar
    Refactor and adapt output format of Timer · 7b977fbd
    David Frank authored and Tobias Lasser's avatar Tobias Lasser committed
    This patch adds 3 changes:
    - Rely on spdlog::stopwatch instead of the 'raw' standard library clock
    - Change the output format a touch to improve readability
    - Rename of variables to express intent better
    As of version 1.8.0 of spdlog a stopwatch is provided. I thought it
    would be nice to justs rely on that one instead of rolling our own (even
    if it's not that hard).
    The other change is the output format. Instead of printing in the format
    '[Timing] [debug] Execution of <caller>: <fn> took <time>ms', I changed
    it to '[<caller>] [debug] <fn> took <time>s'. So instead of having a
    separate Timing logger, the logger for the class is used. IMO, this
    cleans up the log a touch, as my eyes don't have to search in different
    columns, but it's minor. Also I use the default output format of the
    spdlog::stopwatch, which is in decimal and seconds.
    Also I used the change to rename the variables, as it was just a little