diff --git a/cocoa-foundation/src/foundation.rs b/cocoa-foundation/src/foundation.rs index 93e3cd3..80d97ca 100644 --- a/cocoa-foundation/src/foundation.rs +++ b/cocoa-foundation/src/foundation.rs @@ -229,7 +229,12 @@ pub trait NSProcessInfo: Sized { msg_send![class!(NSProcessInfo), processInfo] } + unsafe fn systemUptime(_: Self) -> NSTimeInterval { + msg_send![class!(NSProcessInfo), systemUptime] + } + unsafe fn processName(self) -> id; + unsafe fn uptime(self) -> NSTimeInterval; unsafe fn operatingSystemVersion(self) -> NSOperatingSystemVersion; unsafe fn isOperatingSystemAtLeastVersion(self, version: NSOperatingSystemVersion) -> bool; } @@ -239,6 +244,10 @@ impl NSProcessInfo for id { msg_send![self, processName] } + unsafe fn uptime(self) -> NSTimeInterval { + msg_send![self, systemUptime] + } + unsafe fn operatingSystemVersion(self) -> NSOperatingSystemVersion { msg_send![self, operatingSystemVersion] }