UNPKG
suzanne
Version:
latest (0.0.4)
0.0.4
0.0.2
0.0.1
3D Software Renderer
github.com/nathsou/Suzanne
nathsou/Suzanne
suzanne
/
src
/
Utils
/
Clock.ts
16 lines
(12 loc)
•
286 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
export
class
Clock
{
private
last_tick
:
number
;
constructor
(
) {
this
.
last_tick
=
Date
.
now
(); }
public
getDelta
():
number
{
const
now =
Date
.
now
();
const
delta = now -
this
.
last_tick
;
this
.
last_tick
= now;
return
delta; } }