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.