We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98bee9a commit c8095baCopy full SHA for c8095ba
lib/agent/timer.js
@@ -1,9 +1,10 @@
1
'use strict'
2
3
-function Timer (task, interval) {
+function Timer (task, interval, onEndCb) {
4
this._handle = undefined
5
this.task = task
6
this._interval = interval
7
+ this._onEndCb = onEndCb
8
}
9
10
Timer.prototype.start = function (interval) {
@@ -20,6 +21,10 @@ Timer.prototype.end = function () {
20
21
clearInterval(this._handle)
22
23
24
+
25
+ if (this._onEnd) {
26
+ this._onEndCb()
27
+ }
28
29
30
Timer.prototype.restart = function (interval) {
0 commit comments