-
-
Save FROGGS/ab192c9eac80bcd1b3c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use NativeCall; | |
class cpu_percent_t is repr('CStruct') { | |
has num32 $.user; | |
has num32 $.kernel; | |
has num32 $.idle; | |
has num32 $.iowait; | |
has num32 $.swap; | |
has num32 $.nice; | |
#~ time_t time_taken; | |
} | |
sub cpu_percent_usage() returns cpu_percent_t is native("libstatgrab") { * }; | |
say cpu_percent_usage(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment