rl_lang/interpreter/stdlib/process/sleep.rs
1use crate::{
2 interpreter::{evaluator::Evaluator, values::Value},
3 utils::{errors::Error, span::Span},
4};
5use std::time::Duration;
6
7pub fn std_sleep(_: &mut Evaluator, ms: i64, _: Span) -> Result<Value, Error> {
8 std::thread::sleep(Duration::from_millis(ms.max(0) as u64));
9 Ok(Value::Null)
10}