Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically get current CPU frequency [duplicate]

Tags:

android

cpu

api

Is there any Java API for that? How can I read this information.

like image 595
michael Avatar asked Nov 17 '22 14:11

michael


1 Answers

To have frequency on Android, just read these special files in /sys directory:

#cat "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq"
#cat "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq"
#cat "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"

You will have current, min and max Frequency allowed.

like image 61
Ellis Avatar answered Dec 15 '22 12:12

Ellis