File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 " concurrency" ,
88 " non-blocking" ,
99 " event" ,
10- " event-loop"
10+ " event-loop" ,
11+ " scheduler"
1112 ],
1213 "license" : " MIT" ,
1314 "authors" : [
4041 "autoload" : {
4142 "psr-4" : {
4243 "Revolt\\ " : " src"
43- },
44- "files" : [
45- " src/functions.php"
46- ]
44+ }
4745 },
4846 "autoload-dev" : {
4947 "psr-4" : {
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public function getHandle(): mixed
5757
5858 protected function now (): float
5959 {
60- return now () ;
60+ return ( float ) \hrtime ( true ) / 1_000_000_000 ;
6161 }
6262 };
6363
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 66use Revolt \EventLoop \Driver ;
77use Revolt \EventLoop \InvalidCallbackError ;
88use Revolt \EventLoop \UnsupportedFeatureException ;
9- use function Revolt \now ;
109
1110if (!\defined ("SIGUSR1 " )) {
1211 \define ("SIGUSR1 " , 30 );
@@ -48,10 +47,10 @@ public function testCorrectTimeoutIfBlockingBeforeActivate(): void
4847
4948 $ this ->start (function (Driver $ loop ) use (&$ start , &$ invoked ): void {
5049 $ loop ->defer (function () use ($ loop , &$ start , &$ invoked ) {
51- $ start = now ( );
50+ $ start = \microtime ( true );
5251
5352 $ loop ->delay (1 , function () use (&$ invoked ) {
54- $ invoked = now ( );
53+ $ invoked = \microtime ( true );
5554 });
5655
5756 \usleep (500000 );
@@ -71,12 +70,12 @@ public function testCorrectTimeoutIfBlockingBeforeDelay(): void
7170 $ invoked = 0 ;
7271
7372 $ this ->start (function (Driver $ loop ) use (&$ start , &$ invoked ): void {
74- $ start = now ( );
73+ $ start = \microtime ( true );
7574
7675 \usleep (500000 );
7776
7877 $ loop ->delay (1 , function () use (&$ invoked ) {
79- $ invoked = now ( );
78+ $ invoked = \microtime ( true );
8079 });
8180 });
8281
You can’t perform that action at this time.
0 commit comments