| Line | |
|---|
| 1 | #include "MTimeout.h"
|
|---|
| 2 |
|
|---|
| 3 | #include <TSystem.h>
|
|---|
| 4 |
|
|---|
| 5 | MTimeout::MTimeout(unsigned long ms=500) : fTimeout((ULong_t)gSystem->Now()+ms)
|
|---|
| 6 | {
|
|---|
| 7 | // Use SetTime to change the timing
|
|---|
| 8 | // if (ms) TurnOn(); // Add to system list
|
|---|
| 9 | }
|
|---|
| 10 |
|
|---|
| 11 | bool MTimeout::HasTimedOut()
|
|---|
| 12 | {
|
|---|
| 13 | return fTimeout<(ULong_t)gSystem->Now();
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | void MTimeout::Start(unsigned long ms=500)
|
|---|
| 17 | {
|
|---|
| 18 | fTimeout = (ULong_t)gSystem->Now()+ms;
|
|---|
| 19 | //Reset(); // reset before adding
|
|---|
| 20 | //TurnOn(); // Add to system list
|
|---|
| 21 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.