Skip to content

uupaa/WMClock.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WMClock.js Build Status

npm

WMClock.js description.

Document

How to use

Browser

<script src="lib/WMClock.js"></script>
<script>
var clock = new WMClock([_tick], { vsync: true, start: true });

function _tick(timeStamp, deltaTime, count) {
    console.log("tick:", timeStamp, deltaTime, count);
    if (count === 9) {
        clock.off(_tick);

        clock.nth(function(timeStamp, deltaTime, count) {
            console.log("nth:", timeStamp, deltaTime, count);
            if (count === 9) {
                clock.stop();
                if (!clock.isActive()) {
                    console.log("finished");
                } else {
                    console.log("error");
                }
            }
        }, 10);
    }
}
</script>

WebWorkers

importScripts("lib/WMClock.js");

...

Node.js

var WMClock = require("lib/WMClock.js");

...

About

Master Clock [DEPRECATED] see ▶

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published