MCPcopy Index your code
hub / github.com/RustPython/RustPython / format_timeout

Function format_timeout

crates/stdlib/src/faulthandler.rs:783–797  ·  view source on GitHub ↗
(timeout_us: u64)

Source from the content-addressed store, hash-verified

781 }
782
783 fn format_timeout(timeout_us: u64) -> String {
784 let sec = timeout_us / 1_000_000;
785 let us = timeout_us % 1_000_000;
786 let min = sec / 60;
787 let sec = sec % 60;
788 let hour = min / 60;
789 let min = min % 60;
790
791 // Match Python's timedelta str format: H:MM:SS.ffffff (no leading zero for hours)
792 if us != 0 {
793 format!("Timeout ({}:{:02}:{:02}.{:06})!\n", hour, min, sec, us)
794 } else {
795 format!("Timeout ({}:{:02}:{:02})!\n", hour, min, sec)
796 }
797 }
798
799 fn get_fd_from_file_opt(file: OptionalArg<PyObjectRef>, vm: &VirtualMachine) -> PyResult<i32> {
800 match file {

Callers 1

dump_traceback_laterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected