Question: stuck with question can someone do one as example please and language is pyton 1. Devise a small Python program that executes a repetitive task,

stuck with question can someone do one as example please and language is pyton
stuck with question can someone do one as example please and language

1. Devise a small Python program that executes a repetitive task, such as calling the same function multiple times in a loop. Execute this program and record how long it takes to complete. The specifics of the task do not matter. You can try to complete something practical (you can write a function of your choice for example a function to calculate the sum of numbers (this is just an example, do not use it.)) with the sleep() function. 2. Now update the program to execute each task using a separate thread. Record how long it takes to execute. 3. Compare the execution time between the serial and concurrent versions of the program. Calculate the difference in seconds (e.g. it is faster by 5 seconds). Calculate the ratio that the second program is faster than the first program (e.g. it is 2.5 faster). Your program should calculate and display the result, do not count it manually. These calculations may help: - difference = serial time concurrent time - ratio = serial time / concurrent time If it turns out that the concurrent version of the program is not faster, perhaps change or manipulate the task so that the serial version is slower than the fastersion. 4. Comment your code, all sections of the code should be clearly explained

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!