Multiple Randomized Timers

I modified the example ‘SimpleTimer’ to automatically update. What I would like to do, and am unable, is to have multiple timers update with different random start times. I tried to add another class with a second timer contained within it and still no luck. Any timers I add update with the same random numbers. Here’s the code I am using as a starting point with one timer only. Obviously, I’m just getting started — this is my first project. Any insight is greatly appreciated. Thank you!

.h
class testApp : public ofBaseApp{

public:

void setup();
void update();
void draw();

int startTime;
int endTime;

bool bTimerReached;

};

.cpp
#include “testApp.h”

//--------------------------------------------------------------
void testApp::setup(){

ofBackgroundHex(0xc5c9b2);
}

//--------------------------------------------------------------
void testApp::update(){

if (bTimerReached) {
bTimerReached = false;
startTime = ofGetElapsedTimeMillis();
endTime = (int)ofRandom(1000, 10000);
}

}

//--------------------------------------------------------------
void testApp::draw(){

int timer = ofGetElapsedTimeMillis() - startTime;

if(timer >= endTime && !bTimerReached) {
bTimerReached = true;
}

string info = “FPS: “+ofToString(ofGetFrameRate())+”\n”;
info += “Start Time: “+ofToString(startTime)+”\n”;
info += “End Time: “+ofToString(endTime/1000)+” seconds\n”;
info += “Timer: “+ofToString(timer/1000)+” seconds\n”;
ofSetColor(0);
ofDrawBitmapString(info, 20, 20);
}

you should setup different startTime and endTime variables for every timer; the best thing would probably be to create a timer class and declare multiple instancies of it.

Thank you, naus3a. I made a timer class and it worked.