-
-
Save daum/0010c9133a6ba27c373e898e2bc87c43 to your computer and use it in GitHub Desktop.
Example of breaking a second.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
while(true){ | |
$start = time(); | |
// Sleeps below are not even necessary. | |
// time_nanosleep(0,1); | |
//or can use usleep(1); | |
$end = strtotime('1 week'); | |
if($end-$start > 604800) | |
{ | |
echo "Failed!! ".date('Y-m-d H:i:s',$start).' vs '.date('Y-m-d H:i:s',$end).' start: '.$start.' end: '.$end; | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment