| 49 | } |
| 50 | |
| 51 | void DsTimer::Start(int millsec, CALLBACL_FUNC f) |
| 52 | { |
| 53 | if (_isActived) |
| 54 | return; |
| 55 | |
| 56 | _call = f; |
| 57 | |
| 58 | if (!_binded){ |
| 59 | _binded = true; |
| 60 | connect(&_timer, SIGNAL(timeout()), this, SLOT(on_timeout())); |
| 61 | } |
| 62 | |
| 63 | _timer.start(millsec); |
| 64 | _isActived = true; |
| 65 | _beginTime = high_resolution_clock::now(); |
| 66 | } |
| 67 | |
| 68 | void DsTimer::SetCallback(CALLBACL_FUNC f) |
| 69 | { |
no test coverage detected