mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
Add CLOCK_ constants.
This commit is contained in:
@@ -375,6 +375,20 @@ mod unix {
|
||||
use crate::{PyResult, VirtualMachine};
|
||||
use std::time::Duration;
|
||||
|
||||
#[cfg(target_os = "solaris")]
|
||||
#[pyattr]
|
||||
use libc::CLOCK_HIGHRES;
|
||||
#[cfg(target_os = "linux")]
|
||||
#[pyattr]
|
||||
use libc::{CLOCK_BOOTTIME, CLOCK_MONOTONIC_RAW, CLOCK_TAI};
|
||||
#[pyattr]
|
||||
use libc::{
|
||||
CLOCK_MONOTONIC, CLOCK_PROCESS_CPUTIME_ID, CLOCK_REALTIME, CLOCK_THREAD_CPUTIME_ID,
|
||||
};
|
||||
#[cfg(any(target_os = "freebsd", target_os = "openbsd"))]
|
||||
#[pyattr]
|
||||
use libc::{CLOCK_PROF, CLOCK_UPTIME};
|
||||
|
||||
#[pyfunction]
|
||||
fn sleep(dur: Duration, vm: &VirtualMachine) -> PyResult<()> {
|
||||
// this is basically std::thread::sleep, but that catches interrupts and we don't want to;
|
||||
|
||||
Reference in New Issue
Block a user