The follwing function returns a microtime(stamp) with 10 digits for the integer,
and most of the time 18 digits sometimes less for the fractional part.
18 digits decimal is nearly a 64 bits number, so a very hi resolution/subdivision
of the second.
function mts()
{
$_p = ini_get('precision');
ini_set('precision', 28);
$mts = (string)microtime(true);
ini_set('precision', $_p);
return $mts;
}
In a single request I can call mts in the tightest possible loop and never get
an equal return value because the resolution is just too high.
But what would the results be in many overlapping requests on the same server,
with multiple processors and or multiple network cards. Is there always some kind
of request sychronisation required before spawning a request handling thread?
In other words, will mts() working in multiple thread always generate unique
values?
and most of the time 18 digits sometimes less for the fractional part.
18 digits decimal is nearly a 64 bits number, so a very hi resolution/subdivision
of the second.
function mts()
{
$_p = ini_get('precision');
ini_set('precision', 28);
$mts = (string)microtime(true);
ini_set('precision', $_p);
return $mts;
}
In a single request I can call mts in the tightest possible loop and never get
an equal return value because the resolution is just too high.
But what would the results be in many overlapping requests on the same server,
with multiple processors and or multiple network cards. Is there always some kind
of request sychronisation required before spawning a request handling thread?
In other words, will mts() working in multiple thread always generate unique
values?