mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-08-18 16:28:54 +00:00
Document sleep()'s optional parameter (#2488)
This commit is contained in:
+3
-1
@@ -28,7 +28,7 @@ thread, not the whole program.
|
||||
> need to receive events while sleeping, consider using [timers][`os.startTimer`],
|
||||
> or the [parallel API][`parallel`].
|
||||
|
||||
@tparam number time The number of seconds to sleep for, rounded up to the
|
||||
@tparam[opt=0] number time The number of seconds to sleep for, rounded up to the
|
||||
nearest multiple of 0.05.
|
||||
|
||||
@see os.startTimer
|
||||
@@ -37,6 +37,8 @@ nearest multiple of 0.05.
|
||||
print("Sleeping for three seconds")
|
||||
sleep(3)
|
||||
print("Done!")
|
||||
|
||||
@changed 1.63 The `time` parameter is now optional.
|
||||
]]
|
||||
function sleep(time) end
|
||||
|
||||
|
||||
+2
-2
@@ -91,8 +91,8 @@ function pullEventRaw(filter) end
|
||||
|
||||
--- Pauses execution for the specified number of seconds, alias of [`_G.sleep`].
|
||||
--
|
||||
-- @tparam number time The number of seconds to sleep for, rounded up to the
|
||||
-- nearest multiple of 0.05.
|
||||
-- @tparam[opt=0] number time The number of seconds to sleep for, rounded up to
|
||||
-- the nearest multiple of 0.05.
|
||||
function sleep(time) end
|
||||
|
||||
--- Get the current CraftOS version (for example, `CraftOS 1.9`).
|
||||
|
||||
@@ -1434,6 +1434,7 @@ And several bug fixes:
|
||||
* Turtle label nameplates now only show when the Turtle is moused-over
|
||||
* The HTTP API is now enabled by default, and can be configured with a whitelist of permitted domains
|
||||
* `http.get()` and `http.post()` now accept parameters to control the request headers
|
||||
* `sleep()`, when invoked without a parameter, defaults to 0.
|
||||
* New fs function: `fs.getDir( path )`
|
||||
* Fixed some bugs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user