mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-29 23:49:21 -04:00
Merge pull request #1783 from paulkaplan/emit-start-event
Emit a RUNTIME_STARTED event to track if the vm has been started
This commit is contained in:
commit
ffb02c607d
4 changed files with 44 additions and 2 deletions
src/engine
|
@ -605,6 +605,14 @@ class Runtime extends EventEmitter {
|
|||
return 'BLOCKSINFO_UPDATE';
|
||||
}
|
||||
|
||||
/**
|
||||
* Event name when the runtime tick loop has been started.
|
||||
* @const {string}
|
||||
*/
|
||||
static get RUNTIME_STARTED () {
|
||||
return 'RUNTIME_STARTED';
|
||||
}
|
||||
|
||||
/**
|
||||
* How rapidly we try to step threads by default, in ms.
|
||||
*/
|
||||
|
@ -2172,6 +2180,7 @@ class Runtime extends EventEmitter {
|
|||
this._steppingInterval = setInterval(() => {
|
||||
this._step();
|
||||
}, interval);
|
||||
this.emit(Runtime.RUNTIME_STARTED);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue