mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
NSProcessInfo: implement getting system uptime
Introduce the systemUptime property to NSProcessInfo, which can compute platform-independently what is the uptime of the system.
This commit is contained in:
parent
277ae581a6
commit
cbfa4d8cc9
3 changed files with 51 additions and 0 deletions
|
@ -39,8 +39,14 @@ int main()
|
|||
PASS((obj != nil && [obj isKindOfClass:[NSString class]] && [obj length] > 0),
|
||||
"-operatingSystemName works");
|
||||
NSLog(@"operatingSystemName %@", obj);
|
||||
|
||||
val = [info operatingSystem];
|
||||
PASS(val != 0, "-operatingSystem works");
|
||||
|
||||
val = [info systemUptime];
|
||||
NSLog(@"systemUptime %lu", val);
|
||||
PASS(val != 0, "-systemUptime works");
|
||||
|
||||
obj = [info hostName];
|
||||
PASS((obj != nil && [obj isKindOfClass:[NSString class]] && [obj length] > 0),
|
||||
"-hostName works");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue