Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Get Exact Time w/out Modules

by ehdonhon (Curate)
on Nov 17, 2003 at 20:31 UTC ( #307818=note: print w/ replies, xml ) Need Help??


in reply to Get Exact Time w/out Modules

So you have Perl, but no modules. I suspect that you will soon begin to conclude the Perl is a pain to program with. If you aren't going to be able to take advantage of the CPAN, then there seems to be very little sense in having Perl installed at all. It sounds to me like it would be much more to your advantage to program with a lower-level langauge, like C.


Comment on Re: Get Exact Time w/out Modules
Re: Re: Get Exact Time w/out Modules
by Anonymous Monk on Nov 17, 2003 at 21:49 UTC
    For the most part perl covers our needs wonderfully...cases like this are the exception. We don't have a C compiler either (they make you buy an SDK for that), so perl is more or less our only choice.
      If you don't have a C compiler, then you are going to have a hard time solving this problem. Presumably, the operating system has a function that give the time with a higher accuracy than the Perl builtin time(). Calling the C API from Perl requires an XS module compiled by a C compiler.

      The Time::HiRes module provides an interface to the gettimeofday function that will do the job. But you can't compile it because you don't have a C compiler. And can't install Perl modules.

Re: Re: Get Exact Time w/out Modules
by mpeppler (Vicar) on Nov 17, 2003 at 21:52 UTC
    So you have Perl, but no modules. I suspect that you will soon begin to conclude the Perl is a pain to program with
    I'll have to disagree here - while CPAN is incredibly useful, you're still going to be much more productive coding in perl than in C even without access to it, and by using the syscall() built-in you can achieve pretty much anything that you need for low-level system functions. It's much more work than using various perl modules from CPAN, but it should get you there.

    Michael

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (13)
As of 2014-09-30 12:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (368 votes), past polls