nushell/crates/nu-command/src/platform
Doru 669659f974
Improve sleep resolution (#12049)
# Description
This improves the resolution of the sleep commands by simply not
clamping to the default 100ms ctrl+c signal checking loop if the
passed-in duration is shorter.

# User-Facing Changes
You can use smaller values in sleep.

```
# Before
timeit { 0..100 | each { |row| print $row; sleep 10ms; } } # +10sec

# After
timeit { 0..100 | each { |row| print $row; sleep 10ms; } } # +1sec
```

It still depends on the internal behavior of thread::sleep and the OS
timers. In windows it doesn't seem to go much lower than 15 or 10ms, or
0 if you asked for that.

# After Submitting
Sleep didn't have anything documenting its minimum value, so this should
be more in line with its standard procedure. It will still never sleep
for less time than allocated.

Did you know `sleep` can take multiple durations, and it'll add them up?
I didn't
2024-03-02 14:03:56 -06:00
..
ansi Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00
input Name the Value conversion functions more clearly (#11851) 2024-02-17 18:14:16 +00:00
clear.rs Allow clear command to clear terminal's history (#12008) 2024-02-28 07:49:41 -06:00
dir_info.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
is_terminal.rs Fix incorrect handling of boolean flags for builtin commands (#11492) 2024-01-11 17:19:48 +02:00
kill.rs Fix incorrect handling of boolean flags for builtin commands (#11492) 2024-01-11 17:19:48 +02:00
mod.rs refactor: move du from platform to filesystem (#11852) 2024-02-15 06:55:21 +08:00
sleep.rs Improve sleep resolution (#12049) 2024-03-02 14:03:56 -06:00
term_size.rs Create Record type (#10103) 2023-08-25 07:50:29 +12:00
ulimit.rs FreeBSD compatibility patches (#11869) 2024-02-17 20:04:59 +01:00
whoami.rs Convert Shellerror::GenericError to named fields (#11230) 2023-12-07 00:40:03 +01:00