Skip to content

Instantly share code, notes, and snippets.

@MehdiNS
MehdiNS / main.cpp
Last active June 15, 2016 02:08
Generic function timer - could be more fancy but it is good enough
// -First idea was to do it thanks to RAII. Problem is it requires a lot of brackets
// -Then i wanted to go full variadic generic template function,
// but i got stuck because i would have to pass a variadic function
// to a function which doesn't make any sense, and was overkill
// - This solution seems the best for now... Client code is okay-ish...
#include <iostream>
#include <chrono>
#include <thread>
#include <string>