xref: /aosp_15_r20/external/cronet/build/toolchain/get_cpu_count.py (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# Copyright 2018 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5# This script shows cpu count to specify capacity of action pool.
6
7
8import multiprocessing
9import sys
10
11def main():
12  try:
13    cpu_count = multiprocessing.cpu_count()
14  except:
15    cpu_count = 1
16
17  print(cpu_count)
18  return 0
19
20
21if __name__ == '__main__':
22  sys.exit(main())
23