Git Product home page Git Product logo

Comments (4)

dbartolini avatar dbartolini commented on May 22, 2024

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.

zacharycarter avatar zacharycarter commented on May 22, 2024

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.

zacharycarter avatar zacharycarter commented on May 22, 2024

Essentially what I'm looking to get is - clock()/CLOCKS_PER_SEC

from crown.

zacharycarter avatar zacharycarter commented on May 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.