Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Get Exact Time w/out Modules

by simonm (Vicar)
on Nov 17, 2003 at 18:48 UTC ( [id://307785]=note: print w/replies, xml ) Need Help??


in reply to Get Exact Time w/out Modules

I can't use modules

Why not? What's the specific restriction you're dealing with? Site policy? Lack of install permissions? Lack of a compiler? Or... what?

If it's just a distribution problem, consider downloading Time::HiRes and copying bits of its source code into your program...

Replies are listed 'Best First'.
Re: Re: Get Exact Time w/out Modules
by Anonymous Monk on Nov 17, 2003 at 19:03 UTC
    The code is going to be running on an proprietary embedded device. To add software to the image that it runs requires me to pay a hefty sum of money. It has perl already, but no modules.

      If you can't compile libraries, I think you're limited to the time() function and its one second accuracy. (You might be able to qx() out to a command-line program that returned the time with hundredths of a second precision, but that'd probably take long enough that it would throw off your timing.

      Update: Or, as mpeppler points out, you could use syscall(). It sounds like your manufacturer probably didn't include the headers or syscall.ph, but if they did this would be a good workaround.

      then you should consider getting rid of this proprietary device and going for something else. this kind of restrictiveness is like have a 10 ton block of cement chained to your ankle; you will never be able to get anywhere or do anything while you are still tied to it!
        Sadly, in the business world this isn't an option. Already too much money tied up in it by upper management.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-26 04:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found