Coder Social home page Coder Social logo

Comments (5)

orls avatar orls commented on August 20, 2024

I think that'll be usable for wall time, but the on-cpu time will still be microseconds multiplied up – not sure if you'd consider that a problem?

I'll have a go at this soon. I've been meaning to check out the new UI anyway. (It looks amazing, btw!)

from php-spx.

NoiseByNorthwest avatar NoiseByNorthwest commented on August 20, 2024

Damn you're right. I've just forgot the CPU time component. We need the same resolution for both timers otherwise this could lead to some disturbing inconsistencies.
However wall / cpu time inconsistency is theorycally handled. I will check the current behavior on Linux with 1ns wall time and 1us cpu time.

I've also seen here that some later macOS versions have clock_gettime support. According to statcounter.com macOS 10.12+ versions seem to have 60%+ market shares.

from php-spx.

orls avatar orls commented on August 20, 2024

Indeed (If you recall, in my initial impl I polyfilled it for < 10.12 because it was called globally, but then you consolidated all timing into spx_resource_stats-...).

It looks like it supports CLOCK_PROCESS_CPUTIME_ID too, which is great.

Personally I'd like to keep compatibility for 10.11, at least for now (colleagues & special snowflakes)...so how about I implement nsec resolution using clock_gettime for 10.12+ and fall back to usec for <= 10.11? The fallback mess will be isolated to only spx_resource_stats-macos.c.

from php-spx.

NoiseByNorthwest avatar NoiseByNorthwest commented on August 20, 2024

Yes, this is what I was thinking about.
I do not want to break compatibility with 10.11-, but we can do OS version dispatching (confined to spx_resource_stats-macos.c as you said or even subfiles if implementations are totally differents) to implement the optimal clock for each version.

from php-spx.

NoiseByNorthwest avatar NoiseByNorthwest commented on August 20, 2024

Fixed by #36

from php-spx.

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.