Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/d954mas/defold-chronos
High resolution monotonic timers for Defold
https://github.com/d954mas/defold-chronos
Last synced: 4 months ago
JSON representation
High resolution monotonic timers for Defold
- Host: GitHub
- URL: https://github.com/d954mas/defold-chronos
- Owner: d954mas
- License: mit
- Created: 2023-10-06T15:24:58.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-07T12:50:27.000Z (over 1 year ago)
- Last Synced: 2023-10-07T16:20:10.077Z (over 1 year ago)
- Language: C++
- Homepage:
- Size: 8.79 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-defold - Chronos
README
# Chronos for Defold
High resolution monotonic timers for Lua.
https://github.com/ldrumm/chronos## Installation
__1)__ Add defold-chronos in your own project as a Defold library dependency. Open your game.project file and in the dependencies field under project add:
https://github.com/d954mas/defold-chronos/archive/refs/tags/1.0.1.zip## Example
```lua
function update(self, dt)
if chronos then
local time = chronos.nanotime()
local a = 1
for i=1,10000 do
a = a + 1
end
print("seconds:" .. chronos.nanotime() - time)
end
end
```## Api
### chronos.nanotime()
**RETURN**
* (number) - seconds with nanosecond precision`