It's easy to get Epoch-Seconds (timestamp) in perl:
time
But what's with milliseconds? The most effective way seems to be time*1000, but that's not as accurate as I want it to be. Any good hints except for the long terms documented @perldoc?
The Time::HiRes module has a drop-in replacement for time
$ perl -E 'say time'
1298827929
$ perl -MTime::HiRes=time -E 'say time'
1298827932.67446
You can read more in the perl FAQ
perldoc -q "How can I measure time under a second"