Skip to content

Instantly share code, notes, and snippets.

@Yepoleb
Created May 9, 2015 15:53
Show Gist options
  • Save Yepoleb/9452c236187dc4a99930 to your computer and use it in GitHub Desktop.
Save Yepoleb/9452c236187dc4a99930 to your computer and use it in GitHub Desktop.
class Clock
{
public:
Clock();
long reset();
private:
long lasttime;
}
Clock::Clock()
{
lasttime = 0;
}
long Clock::reset()
{
long newtime = getTimehnsec();
long duration = newtime - lasttime;
lasttime = newtime;
return duration;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment