Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename callable, typename ... arguments>
- static float trace(callable && f, arguments &&... args)
- {
- std::function<typename std::result_of<callable(arguments...)>::type()>
- task(std::bind(std::forward<callable>(f), std::forward<arguments>(args)...));
- auto start = std::chrono::system_clock::now();
- task();
- std::chrono::duration<float> dt(std::chrono::system_clock::now() - start);
- return dt.count();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement