35 lines
759 B
JavaScript
35 lines
759 B
JavaScript
|
import rt from 'apigo.cc/gojs/runtime'
|
||
|
import co from 'apigo.cc/gojs/console'
|
||
|
import task from 'apigo.cc/gojs/task'
|
||
|
import u from 'apigo.cc/gojs/util'
|
||
|
|
||
|
const taskName = '「a」'
|
||
|
let runTimes = 0
|
||
|
// let t1
|
||
|
|
||
|
function onStart() {
|
||
|
// co.info(taskName, 'start')
|
||
|
task.getSet('aStarts', old => {
|
||
|
return u.int(old) + 1
|
||
|
})
|
||
|
// t1 = u.timestampMS()
|
||
|
}
|
||
|
|
||
|
let i = 0
|
||
|
function onRun() {
|
||
|
// co.info(taskName, 'run======================', runTimes, u.timestampMS() - t1)
|
||
|
runTimes++
|
||
|
task.push('aRunTime', runTimes)
|
||
|
task.getSet('aRunTimes', old => {
|
||
|
return u.int(old) + 1
|
||
|
})
|
||
|
// rt.sleep(1500)
|
||
|
}
|
||
|
|
||
|
function onStop() {
|
||
|
// co.info(taskName, 'stop')
|
||
|
task.getSet('aStops', old => {
|
||
|
return u.int(old) + 1
|
||
|
})
|
||
|
}
|