-
-
Notifications
You must be signed in to change notification settings - Fork 104
Open
Description
系统:Darwin
代码(参考示例):
use std::time::Instant;
use xcap::Window;
fn normalized(filename: &str) -> String {
filename.replace(['|', '\\', ':', '/'], "")
}
#[test]
fn main() {
let start = Instant::now();
let windows = Window::all().unwrap();
for window in windows {
println!(
"Window: {:?} {:?} {:?}",
window.title().unwrap(),
(
window.x().unwrap(),
window.y().unwrap(),
window.width().unwrap(),
window.height().unwrap()
),
(
window.is_minimized().unwrap(),
window.is_maximized().unwrap()
)
);
}
println!("运行耗时: {:?}", start.elapsed());
}
输出:
Window: "Menubar" (0, 0, 1728, 37) (false, false)
运行耗时: 69.463125ms
Metadata
Metadata
Assignees
Labels
No labels