mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 07:35:34 +08:00
fix zm_sleep float bug and add test
This commit is contained in:
@@ -76,4 +76,11 @@ class GlobalFunctionsTest extends TestCase
|
||||
{
|
||||
$this->assertEquals(['code' => 0, 'signal' => 0, 'output' => "foo\n"], zm_exec('echo foo'));
|
||||
}
|
||||
|
||||
public function testZmSleep(): void
|
||||
{
|
||||
$starttime = microtime(true);
|
||||
zm_sleep(0.001);
|
||||
$this->assertGreaterThanOrEqual(0.001, microtime(true) - $starttime);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user