in reply to Time in Milliseconds or NanoSeconds
Time::HiRes gives high precision time, though nanosecond resolution is unlikely.
The better idea is File::Temp. Timestamps are notoriously unreliable for your need.
After Compline,Zaxo