| 100 | } |
| 101 | |
| 102 | int64_t setInterval (uint32_t interval) |
| 103 | { |
| 104 | auto timerID = ++nextTimerID; |
| 105 | |
| 106 | activeTimers[timerID] = choc::messageloop::Timer (interval, [this, timerID] |
| 107 | { |
| 108 | try |
| 109 | { |
| 110 | context.invoke ("_choc_invokeInterval", timerID); |
| 111 | } |
| 112 | catch (const choc::javascript::Error& e) |
| 113 | { |
| 114 | std::cerr << e.what() << std::endl; |
| 115 | } |
| 116 | |
| 117 | return true; |
| 118 | }); |
| 119 | |
| 120 | return timerID; |
| 121 | } |
| 122 | |
| 123 | void clearInterval (int64_t timerID) |
| 124 | { |
no test coverage detected