Saturday, October 1, 2022

#1 2022-08-13 11:08:18 am

KniazidisR
Member
From:: Greece
Registered: 2019-03-03
Posts: 2524

CPU usage Info As Record (for quick monitoring)

Applescript:


on cpuUsageInfoRecord()
   set {ATID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {": ", ", ", "% "}}
   set cpuUsageInfo to text items of (do shell script "top -l 1 | grep 'CPU usage'")
   set AppleScript's text item delimiters to ATID
   tell cpuUsageInfo to return {user:item 2 as real, sys:item 4 as real, |idle|:item 6 as real}
end cpuUsageInfoRecord

my cpuUsageInfoRecord()


Model: MacBook Pro
OS X: Catalina 10.15.7
Web Browser: Safari 14.1
Ram: 4 GB

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)