Skip to content

Commit 92bae14

Browse files
authored
Auto merge of #477 - n-eq:processinfo-uptime, r=jrmuizel
Add ProcessInfo.systemUptime implementation Hello, Added [NSProcessInfo.systemUptime](https://developer.apple.com/documentation/foundation/processinfo/1414553-systemuptime) implementation, successfully tested on iOS. Feel free to merge. Best,
2 parents 8c72b7d + 6e78ddf commit 92bae14

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cocoa-foundation/src/foundation.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ pub trait NSProcessInfo: Sized {
229229
msg_send![class!(NSProcessInfo), processInfo]
230230
}
231231

232+
unsafe fn systemUptime(self) -> NSTimeInterval;
232233
unsafe fn processName(self) -> id;
233234
unsafe fn operatingSystemVersion(self) -> NSOperatingSystemVersion;
234235
unsafe fn isOperatingSystemAtLeastVersion(self, version: NSOperatingSystemVersion) -> bool;
@@ -239,6 +240,10 @@ impl NSProcessInfo for id {
239240
msg_send![self, processName]
240241
}
241242

243+
unsafe fn systemUptime(self) -> NSTimeInterval {
244+
msg_send![self, systemUptime]
245+
}
246+
242247
unsafe fn operatingSystemVersion(self) -> NSOperatingSystemVersion {
243248
msg_send![self, operatingSystemVersion]
244249
}

0 commit comments

Comments
 (0)