Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: The most precise second (timer)

by Don Coyote (Hermit)
on Nov 26, 2019 at 19:20 UTC ( [id://11109280]=note: print w/replies, xml ) Need Help??


in reply to The most precise second (timer)

For finer resolution you could try select rbits,wbits,ebits,timeout, though I don't think this is what you are really after.

select(undef,undef,undef, $start - time()); #...4962.38324 #...4963.39886 #...4964.41448

If you just plug in your calculated difference that gets closer. But again, I don't think thats really what you are after.

select(undef,undef,undef, 0.9993); #output #....5554.40476 #....5555.40476 #....5556.40476

I was wondering if there was a solution that could be derived from using the complements of the numbers, as I have recently been looking at these. I got as close as 0.00129 difference from a second, on the first iteration. Whether its truly to spec, or could be refined, I am not sure, though it looks like something might be there.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11109280]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 21:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found