#pragma once
#include "mirage_type.h"

class mirage_scoped_duration_timer {
public:
	explicit mirage_scoped_duration_timer(duration_type& out_duration) : duration(out_duration) {
		start_time = get_current_time();
	}
	~mirage_scoped_duration_timer() {
		duration = get_current_time() - start_time;
	}
private:
	time_type start_time;
	duration_type& duration;
};
