Skip to content

⬅️ Back to Table of Contents

📄 Clock.tests.js

📊 Analysis Summary

Metric Count
🔧 Functions 5
📦 Imports 1
📊 Variables & Constants 4

📚 Table of Contents

🛠️ File Location:

📂 test/unit/src/core/Clock.tests.js

📦 Imports

Name Source
Clock ../../../../src/core/Clock.js

Variables & Constants

Name Type Kind Value Exported
reference typeof globalThis let/var ( typeof global !== 'undefined' ) ? global : self
object Clock let/var new Clock()
object_all Clock let/var new Clock( false )
clock Clock let/var new Clock( false )

Functions

mockPerformance(): void

Returns: void

Code
function mockPerformance() {

            const reference = ( typeof global !== 'undefined' ) ? global : self;

            reference.performance = {
                deltaTime: 0,

                next: function ( delta ) {

                    this.deltaTime += delta;

                },

                now: function () {

                    return this.deltaTime;

                }

            };

        }

next(delta: any): void

Parameters:

  • delta any

Returns: void

Code
function ( delta ) {

                    this.deltaTime += delta;

                }

now(): any

Returns: any

Code
function () {

                    return this.deltaTime;

                }

next(delta: any): void

Parameters:

  • delta any

Returns: void

Code
function ( delta ) {

                    this.deltaTime += delta;

                }

now(): any

Returns: any

Code
function () {

                    return this.deltaTime;

                }