⭐ in reply to Is there a way to call time() with an increment smaller than seconds?
which sets the key to a combination of the time in seconds and the process ID. This combination will be unique, as long as each time the script is run it generates a single key (e.g. a web script). If the script generates more than one key per second, add a counter:$mykey = "$^T$$";
$mykey = "$^T$$" . $x++;
If you do need sub-second times, you can look at the Time::HiRes module, although it may not work on your system, as it uses syscall and gettimeofday(2) in C. Probably easier overall to use the technique above.
|
|---|