Akshay J
Akshay J

Reputation: 5458

Python using more than 1 thread

I used the below code:

import time


def create_square(num):
    time.sleep(5)
    return num * num


create_square(12)
create_square(12)
create_square(12)

In task manager, why does it show 4 threads ?

enter image description here

Upvotes: 0

Views: 40

Answers (1)

gonczor
gonczor

Reputation: 4146

It shows how many threads your interpreter has, not how many threads are there in your code.

Upvotes: 1

Related Questions