MCPcopy Create free account
hub / github.com/codecombat/codecombat / startTimer

Method startTimer

app/core/ViewVisibleTimer.js:73–86  ·  view source on GitHub ↗
(featureData)

Source from the content-addressed store, hash-verified

71 }
72
73 startTimer (featureData) {
74 this.featureData = featureData
75 const { viewName, featureName, premiumThang } = this.featureData // eslint-disable-line no-unused-vars
76 if (!viewName) {
77 throw new Error('No view name!')
78 }
79 if (this.running && ((window.performance.now() - this.startTime) > this.throttleRate)) {
80 throw (new Error('Starting a timer over another one!'))
81 }
82 if (!this.running && (!this.startTime || ((window.performance.now() - this.startTime) > this.throttleRate))) {
83 this.running = true
84 this.startTime = window.performance.now()
85 }
86 }
87
88 stopTimer (param) {
89 if (param == null) { param = { } }

Callers 2

onAwayBackMethod · 0.95
onVisibleMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected