mirror of
https://github.com/lxsang/Diya-API.git
synced 2024-12-27 03:48:21 +01:00
31 lines
523 B
Smalltalk
31 lines
523 B
Smalltalk
Class {
|
|
#name : #DiyaClock,
|
|
#superclass : #DiyaSingleton,
|
|
#instVars : [
|
|
'monotonic',
|
|
'lastTick'
|
|
],
|
|
#category : #'Diya-Runtime'
|
|
}
|
|
|
|
{ #category : #initialization }
|
|
DiyaClock >> delta [
|
|
^(DateAndTime now) - lastTick
|
|
]
|
|
|
|
{ #category : #initialization }
|
|
DiyaClock >> elapsedTime [
|
|
^(DateAndTime now) - monotonic
|
|
]
|
|
|
|
{ #category : #initialization }
|
|
DiyaClock >> initialize [
|
|
monotonic := DateAndTime now.
|
|
lastTick := monotonic.
|
|
]
|
|
|
|
{ #category : #initialization }
|
|
DiyaClock >> tick [
|
|
lastTick := DateAndTime now.
|
|
]
|