mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
8b39a57be7
Added complete call-seq documentation for thread suspension methods in src/sleep.c: ## Core Methods: ### sleep: - Suspends current thread for specified duration in seconds - Supports floating point precision when MRB_NO_FLOAT is not defined - Returns actual number of seconds slept (rounded) - Cross-platform implementation (Windows Sleep vs Unix nanosleep) - Comprehensive examples showing fractional second delays ### usleep: - Suspends current thread for specified duration in microseconds - Provides microsecond-level precision for short delays - Integer-only parameter for precise timing control - Returns 0 on successful completion - Examples demonstrating millisecond and microsecond delays Co-authored-by: Atlassian Rovo Dev
Sleep Module for mruby
mruby sleep module
Install by mrbgems
- add
conf.gemline to your build configuration.
MRuby::Build.new do |conf|
# ... (snip) ...
conf.gem :core => 'mruby-sleep'
end
Example
sleep(10)
usleep(10000)
License
under the MIT License: