52

Possible Duplicate:
python - how to get the numebr of active threads started by specific class?

I'm new in python, i want to get count of running threads at any time...is there any built in support for this or i have to maintain it manually (e.g. count veriable...) ?

Community
  • 1
  • 1
Sufyan Ali
  • 549
  • 1
  • 4
  • 4

1 Answers1

99

threading.active_count() seems to be what you're looking for :

Return the number of Thread objects currently alive

Andy Baker
  • 21,158
  • 12
  • 58
  • 71
Cédric Julien
  • 78,516
  • 15
  • 127
  • 132