Skip to content
Snippets Groups Projects
Commit 45e3f759 authored by René Fritze's avatar René Fritze
Browse files

time guard

parent 18cc078f
No related branches found
No related tags found
No related merge requests found
......@@ -920,6 +920,21 @@ T clamp(const T var, const T min, const T max)
return ((var < min) ? min : (var > max) ? max : var);
}
struct TimeGuard
{
const time_t cur_time;
TimeGuard()
: cur_time(time(NULL))
{
}
~TimeGuard()
{
time_t delta = time(NULL) - cur_time;
std::cout << ctime(&delta) << std::endl;
}
};
} // end namepspace stuff
#endif // end of stuff.hh
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment