Comments (4)
You can use standard lua stuff: http://www.lua.org/pil/22.1.html
Is there anything particular you would like to have that is not covered by that?
from crown.
I read those but I was concerned (and quite probably an invalid concern) about the precision of the time that the lua calls would be returning. Right now my goal is to grab the current system time so I can use it to adjust a shaders alpha blending using it. I'll give it a shot using the lua date / time stuff and see if I can't get it working. If I end up needing a more precise system time I'll reopen this.
from crown.
Essentially what I'm looking to get is - clock()/CLOCKS_PER_SEC
from crown.
os.clock is what I was looking for :
The os.clock function returns the number of seconds of CPU time for the program. Its typical use is to benchmark a piece of code:
local x = os.clock()
local s = 0
for i=1,100000 do s = s + i end
print(string.format("elapsed time: %.2f\n", os.clock() - x))
http://www.lua.org/pil/22.1.html - just for future reference / in case I forget in the future
from crown.
Related Issues (20)
- tools: Console's text should be cleared when switching projects
- How to build on MSYS2 MINGW64? HOT 2
- [MSYS2 MINGW64] Please replace pkg-config with pkgconf
- [MSYS2 MINGW64] Error when building - it doesn't support make jobs? HOT 2
- runtime: add FilesystemNetwork to boot from remote servers
- tools: add font importer
- I have successfully compiled the code according to the tutorial. How to run and debug it using vs2019 HOT 1
- runtime: add resource bundles
- tools: restore window state HOT 2
- tools: fix camera framing in unit_preview.lua
- samples: add gui sample
- data-compiler: generate requirements for Lua API calls
- tools: undo/redo does not update the Level Editor window's title
- runtime: android: touch pressed/released events miss axis data
- tools: create a proper Deploy Project dialog
- tools, runtime: add particles
- tools: custom icons
- tools: thumbnail generator
- tools: add Icon View alternative mode to the Project Browser
- runtime: add Material.set_texture()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crown.