Files
mruby-mruby/mrbgems/mruby-sleep
Yukihiro "Matz" Matsumoto 8b39a57be7 mruby-sleep: add comprehensive call-seq documentation for sleep functionality
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
2025-08-14 10:52:47 +09:00
..
2021-03-01 10:06:17 +10:00
2021-05-03 23:17:04 +09:00
2024-05-09 17:08:27 +09:00

Sleep Module for mruby

mruby sleep module

Install by mrbgems

  • add conf.gem line 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: