https://github.com/halide/Halide
Raw File
Tip revision: f8260025de1541d5760c16f809378906e3044d0d authored by Alexander on 25 August 2023, 22:26:23 UTC
Merge branch 'rootjalex/x86-sat' of github.com:halide/Halide into rootjalex/x86-sat
Tip revision: f826002
clock.h
#ifndef HALIDE_TUTORIAL_CLOCK_H
#define HALIDE_TUTORIAL_CLOCK_H

// A current_time function for use in the tests.  Returns time in
// milliseconds.

#include "halide_benchmark.h"

inline double current_time() {
    static auto start_time = Halide::Tools::benchmark_now().time_since_epoch();

    auto now = Halide::Tools::benchmark_now().time_since_epoch() - start_time;
    return std::chrono::duration_cast<std::chrono::microseconds>(now).count() / 1e3;
}

#endif  // HALIDE_TUTORIAL_CLOCK_H
back to top