File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -58,19 +58,17 @@ PHP_FUNCTION(uniqid)
58
58
Z_PARAM_BOOL (more_entropy )
59
59
ZEND_PARSE_PARAMETERS_END ();
60
60
61
- if (!more_entropy ) {
62
- /* This implementation needs current microsecond to change,
63
- * hence we poll time until it does. This is much faster than
64
- * calling usleep(1) which may cause the kernel to schedule
65
- * another process, causing a pause of around 10ms.
66
- */
67
- do {
68
- (void )gettimeofday ((struct timeval * ) & tv , (struct timezone * ) NULL );
69
- } while (tv .tv_sec == prev_tv .tv_sec && tv .tv_usec == prev_tv .tv_usec );
61
+ /* This implementation needs current microsecond to change,
62
+ * hence we poll time until it does. This is much faster than
63
+ * calling usleep(1) which may cause the kernel to schedule
64
+ * another process, causing a pause of around 10ms.
65
+ */
66
+ do {
67
+ (void )gettimeofday ((struct timeval * ) & tv , (struct timezone * ) NULL );
68
+ } while (tv .tv_sec == prev_tv .tv_sec && tv .tv_usec == prev_tv .tv_usec );
70
69
71
- prev_tv .tv_sec = tv .tv_sec ;
72
- prev_tv .tv_usec = tv .tv_usec ;
73
- }
70
+ prev_tv .tv_sec = tv .tv_sec ;
71
+ prev_tv .tv_usec = tv .tv_usec ;
74
72
75
73
sec = (int ) tv .tv_sec ;
76
74
usec = (int ) (tv .tv_usec % 0x100000 );
You can’t perform that action at this time.
0 commit comments