HEX
Server: Apache
System: Linux webm003.cluster123.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64
User: vanessatli (59366)
PHP: 5.4.45
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/vanessatli/www/wp-content/plugins/wordfence/modules/login-security/classes/utility/sleep.php
<?php

namespace WordfenceLS;

class Utility_Sleep {
	
	/**
	 * Implements sleep in a way that supports fractional seconds. This is necessary because `usleep` is documented
	 * as only supporting partial seconds (i.e., anything sub-1 second) while `sleep` only supports whole number
	 * seconds. For durations above 1 second with a fractional amount, we end up calling both.
	 * 
	 * @param int|float $seconds
	 */
	public static function sleep($seconds) {
		if ($seconds >= 1) {
			sleep((int) $seconds);
			$seconds -= (int) $seconds;
		}
		
		if ($seconds > 0) {
			usleep((int) (1000000 * $seconds));
		}
	}
}