https://github.com/halide/Halide
Raw File
Tip revision: cd1e94d505f0d238b37f0012d53cc0e9bd2b44c9 authored by Steven Johnson on 07 February 2020, 22:56:56 UTC
Forbid debug_to_file() on vectorized Funcs (Issue #4596)
Tip revision: cd1e94d
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