I am getting an error when I run my code: "threads can only be started once"
it has to do with my for I in range(10)
I kill the threads right after I start it so in theory all threads should be killed before going back into the next loop to create another set of threads.
What I am trying to do is to get the time it takes to run a thread
def __startThreads__(self):
print("How Many =", self.howMany)
start1 = time()
for i in range(10):
start2 = time()
for i in range(self.howMany):
self.threads.append( ThreadEntity( str(i), iAmTheProgramCode ) )
for each in self.threads:
each.start()
for each in self.threads:
each.killThreadEntity()
stop2 = time()
threadtime = stop2 - start2
print(threadtime)
stop1 = time()
threadTotalTime = stop1 - start1
print(threadTotalTime)