nushell/crates/nu-system/src
Ondrej Baudys e266590813
Fix ps command CPU usage on Apple Silicon M1 macs. #4142 (#6457)
* Fix ps command CPU usage on Apple Silicon M1 macs. #4142

The cpu user and system times returned my libproc are not in
nanoseconds; they are in mach ticks units.  This is not documented very
well.  The convert from mach ticks to ns, the kernel provides a timebase
info function and datatype:

https://developer.apple.com/documentation/driverkit/3433733-mach_timebase_info

The commit makes the PS command work for me.

* Cargo fmt of previous commit.

* Clippy format suggestion

Co-authored-by: Ondrej Baudys <ondrej.baudys@nextgen.net>
2022-09-01 18:09:52 +12:00
..
foreground.rs Try again: in unix like system, set foreground process while running external command (#6273) 2022-08-18 05:41:01 -05:00
lib.rs Try again: in unix like system, set foreground process while running external command (#6273) 2022-08-18 05:41:01 -05:00
linux.rs Fix ps command on linux (#6047) 2022-07-14 06:20:54 -05:00
macos.rs Fix ps command CPU usage on Apple Silicon M1 macs. #4142 (#6457) 2022-09-01 18:09:52 +12:00
main.rs Fix build on *BSD, illumos, etc. (#6456) 2022-09-01 12:34:26 +12:00
signal.rs Try again: in unix like system, set foreground process while running external command (#6273) 2022-08-18 05:41:01 -05:00
windows.rs Try again with math-like externals (#4629) 2022-02-24 14:02:28 -05:00