inflop/Countimer

isCounterRunning() not working?

code-al opened this issue · 5 comments

I'm trying to use this function but it isn't recognized. Help?

Oh yes, it's not implemented yet ;) Try use !isStopped() && !isCounterCompleted() condition at this moment. Let me know if it helps.

Yes, im currently using isStopped as alternative. Thanks

dbcom commented

Hi!
Great job on the timer.

Would the below code work as a quick and dirty workaround for isCounterRunning?

// Returns true if counter is still running, otherwise returns false.
bool isCounterRunning();

void Countimer::isCounterRunning()
{
// timer is running only if is not completed or not stopped.
if (_isCounterCompleted || _isStopped) return (true);
return (false);
)

@dbcom, try this:

// Returns true if counter is still running, otherwise returns false.
bool Countimer::isCounterRunning() {
    // timer is running only if is not completed and not stopped.
    return !_isCounterCompleted && !_isStopped;
}
dbcom commented

Thanks!