Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clock-manager

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clock-manager

[![Latest NPM release](https://img.shields.io/npm/v/clock-manager.svg)](https://www.npmjs.com/package/clock-manager) ![MIT License](https://img.shields.io/npm/l/clock-manager.svg)

  • 0.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

clock-manager

Latest NPM release MIT License

demos

  • basic

Usage

$ npm install --save clock-manager

1. make an instance and start it

const clock = new ClockManager();
clock.start();

2. update in your requestAnimationFrames

You can get deltaTime and elapsedTime then.

( anim() {

	requestAnimationFrame( anim );
	clock.update();
	const delta = clock.deltaTime;
	const elapsed = clock.elapsedTime;
	updateSOmething( delta );
	renderSomething();

} )();

even in a separate place

function renderSomething() {

	const updatedDelta = clock.deltaTime;

}

other features

  • clock.start() : start / restart.
  • clock.stop() : stop the clock.
  • clock.elapsedTime( number ) : time travel like, rewind and forward.
  • clock.update() : update clock for the delta frame. this is usually executed in the beginning of requestAnimationFrame.

and getters:

  • clock.deltaTime
  • clock.elapsedTime

Keywords

FAQs

Package last updated on 11 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc