Trouble with Timer

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

Trouble with Timer

Post by cameron » January 14th, 2013, 12:27 am

Im trying to make a timer that does an action very 10 seconds but I cant get it to work.


class Income
{
public:
Income()
:
Bank( 0 ),
x( 0 ),
time( 0 )
{}
void GetIncome()
{
time = timer.GetTimeMilli();
if( x == 0 )
{
timer.StartWatch();
x = 1;
}
if( time == 1000 )
{
timer.StopWatch();
Bank += 1;
x = 0;
}
}
public:
int Bank;
private:
int time;
Timer timer;
int x;
};

Does anyone know what I did wrong?
Computer too slow? Consider running a VM on your toaster.

cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

Re: Trouble with Timer

Post by cameron » January 14th, 2013, 3:56 am

Wow ummm nevermind I solved it.
Computer too slow? Consider running a VM on your toaster.

Post Reply