testing promises with php

This commit is contained in:
2019-11-22 20:34:10 +01:00
commit 3a4b04c1ec
5 changed files with 93 additions and 0 deletions

6
promises/sleep.php Normal file
View File

@ -0,0 +1,6 @@
<?php
$s = ((int)$_GET['s']?: random_int(2, 5));// * 1000000;
sleep($s);
//printf("\$µs=%d", $s);
printf("\$s=%d", $s);