summaryrefslogtreecommitdiff
path: root/macro.h
blob: c92b8365726ac7096f43d109cb6d184a6e4667d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#pragma once

#include <chrono>
#include <iostream>

#define start_timer(name) \
    std::chrono::steady_clock::time_point begin_ ## name = \
        std::chrono::steady_clock::now(); \
    \

#define stop_timer(name) \
    std::chrono::steady_clock::time_point end_ ## name = \
    std::chrono::steady_clock::now(); \
    // std::cout << #name << " (us): " \
    // << std::chrono::duration_cast<std::chrono::microseconds>( \
    //     end_ ## name - begin_ ## name) \
    // << std::endl;