March 19, 2015
8:54 a.m.
2015-03-19 9:05 GMT+01:00 Torsten Bergmann <astares@gmx.de>:
Julien Delplanque wrote:
I can't find out how to get the uptime of the OS from pharo
(FileSystem disk root / 'proc' / 'uptime') asFileReference readStreamDo: [:s | s upToEnd asString ]
or if you load the "OSUnix" project in Pharo 4 from the config browser it is even easier:
UnixSystem upTime
bye T.
And, if there is a system library that provides this data, there is the NativeBoost way: For example( not linux but windows): new method: NBWin32Shell>>#getUptime <primitive: #primitiveNativeCall module: #NativeBoostPlugin error: errorCode > ^ self nbCall: #( ulonglong GetTickCount64() ) module: #Kernel32 and then you can call it like that: NBWin32Shell getUptime milliSeconds.