Skip to content

Instantly share code, notes, and snippets.

@yangweigbh
Created July 4, 2020 03:36
Show Gist options
  • Save yangweigbh/e3cdc9fb465aab7fa01dfa281751aec6 to your computer and use it in GitHub Desktop.
Save yangweigbh/e3cdc9fb465aab7fa01dfa281751aec6 to your computer and use it in GitHub Desktop.
if (sustainedPerformanceModeInUse) {
// Keep at least one core busy. Together with a single threaded benchmark, this
// makes the process get multi-threaded setSustainedPerformanceMode.
//
// We want to keep to the relatively lower clocks of the multi-threaded benchmark
// mode to avoid any benchmarks running at higher clocks than any others.
//
// Note, thread names have 15 char max in Systrace
thread(name = "BenchSpinThread") {
Process.setThreadPriority(Process.THREAD_PRIORITY_LOWEST)
while (true) {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment