Skip to content

Instantly share code, notes, and snippets.

@daum

daum/test.php Secret

Last active July 6, 2017 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daum/0010c9133a6ba27c373e898e2bc87c43 to your computer and use it in GitHub Desktop.
Save daum/0010c9133a6ba27c373e898e2bc87c43 to your computer and use it in GitHub Desktop.
Example of breaking a second.
<?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