42

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
  • 449
  • 1
  • 4
  • 4

1 Answers1

85

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

Return the number of Thread objects currently alive

Andy Baker
  • 20,429
  • 11
  • 56
  • 71
Cédric Julien
  • 74,806
  • 15
  • 120
  • 127