Thek has asked for the wisdom of the Perl Monks concerning the following question:
I am using time() in Linux system to get current epoch. most of the cases, it gives correct epoch. but 3/4 times in every hour, it gives the epoch which is ahead of the current time.
have a look at my function,
sub fetch_time { Other variables declarations ... my($cur_ts); <-- variable in which I am going to receive the epoch Other variables declarations ... # get the current timestamp $cur_ts = time(); <-- fetching current epoch print "$cur_ts;\n"; Other operations ... } Samples sample 1: system epoch - 1234867548 epoch printed - 1234871946 sample 2: system epoch - 1234868856 epoch printed - 1234873254 sample 3: system epoch - 1234928039 epoch printed - 1234932437
What may be the cause for this problem?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: epoch time from time()
by targetsmart (Curate) on Feb 18, 2009 at 08:43 UTC | |
|
Re: epoch time from time()
by ikegami (Patriarch) on Feb 18, 2009 at 14:15 UTC | |
|
Re: epoch time from time()
by dHarry (Abbot) on Feb 18, 2009 at 08:52 UTC |