Multiple High Resolution Timer Class for Windows – C++


Earlier i had posted a tutorial on doing high resolution timing on windows and i’d given a very basic class to act as a timer, now i found when doing my graphics work i often needed multiple timers and so i just extended my baby timer class a little to support multiple timers.

So you can create as many timers as you need on the fly (the controller class acts as a big timer vector) and also get a pointer back for each timer if you wish to create a easily readable shortcut ie.

HRTimer* animationTimer = timers[5];

hope you find it useful: MHRTimer.h

Advertisement

2 thoughts on “Multiple High Resolution Timer Class for Windows – C++

  1. I need a somewhat specialized C++ timer class. My task is:

    while (!EOF)
    read record from file into two variables
    use one variable as a parameter for a function
    use other variable as timer interval
    start timer
    when interval is reached, execute another function
    stop timer
    endwhile

    Can you help?

    Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s