Skip to content

Commit

Permalink
Don't use global setTimeout, see phetsims/phet-info#59
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Mar 18, 2021
1 parent 5f7dac8 commit 4b549ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/common/CollisionLabUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @author Brandon Li
*/

import stepTimer from '../../../axon/js/stepTimer.js';
import Bounds2 from '../../../dot/js/Bounds2.js';
import Utils from '../../../dot/js/Utils.js';
import Vector2 from '../../../dot/js/Vector2.js';
Expand Down Expand Up @@ -320,7 +321,7 @@ const CollisionLabUtils = {
*/
sleep( time ) {
if ( assert ) {
return new Promise( resolve => setTimeout( resolve, time * 1000 ) );
return new Promise( resolve => stepTimer.setTimeout( resolve, time * 1000 ) );
}
else {
throw new Error( 'CollisionLabUtils.sleep must be used with assertions on' );
Expand Down

0 comments on commit 4b549ce

Please sign in to comment.