#include "MTimeout.h"

#include <TSystem.h>

MTimeout::MTimeout(unsigned long ms=500) : fTimeout((ULong_t)gSystem->Now()+ms)
{
    // Use SetTime to change the timing
    // if (ms) TurnOn(); // Add to system list
}

bool MTimeout::HasTimedOut()
{
    return fTimeout<(ULong_t)gSystem->Now();
}

void MTimeout::Start(unsigned long ms=500)
{
    fTimeout = (ULong_t)gSystem->Now()+ms;
    //Reset();  // reset before adding
    //TurnOn(); // Add to system list
}
