https://github.com/halide/Halide
Raw File
Tip revision: 3a24168521e846325a950f5b610f8cee8da2f719 authored by Steven Johnson on 05 June 2024, 17:10:56 UTC
Merge branch 'abadams/fix_lossless_cast_of_sub' into srj/lossless-test
Tip revision: 3a24168
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