https://github.com/halide/Halide
Raw File
Tip revision: b7a20b6962324d217461c44436524afaa2a4fe4d authored by Derek Gerstmann on 08 May 2023, 21:52:41 UTC
Fix missing initializer for vulkan memory config that got munged in a previous merge.
Tip revision: b7a20b6
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