* @brief Creates and starts the poll timer on the worker thread. */
| 59 | * @brief Creates and starts the poll timer on the worker thread. |
| 60 | */ |
| 61 | void DataModel::JsWatchdogWorker::begin() |
| 62 | { |
| 63 | Q_ASSERT(QThread::currentThread() == thread()); |
| 64 | if (m_timer) |
| 65 | return; |
| 66 | |
| 67 | m_timer = new QTimer(this); |
| 68 | m_timer->setInterval(kPollIntervalMs); |
| 69 | connect(m_timer, &QTimer::timeout, this, &JsWatchdogWorker::onTick); |
| 70 | m_timer->start(); |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * @brief Stops and releases the poll timer on the worker thread. |