mirror of
https://github.com/lune-org/lune.git
synced 2025-04-10 13:30:53 +01:00
18 lines
485 B
Lua
18 lines
485 B
Lua
local process = require("@lune/process")
|
|
|
|
-- Spawning a child process should not block the main thread
|
|
|
|
local SAMPLES = 400
|
|
|
|
for _ = 1, SAMPLES do
|
|
local start = os.time()
|
|
local child = process.create("echo", { "hello, world" })
|
|
|
|
assert(child ~= nil, "Failed to spawn child process")
|
|
|
|
local delta = os.time() - start
|
|
assert(
|
|
delta <= 1,
|
|
`Spawning a child process should not block the main thread, process.spawn took {delta}s to return when it should return immediately`
|
|
)
|
|
end
|