Created
January 14, 2018 09:34
-
-
Save santosh/4fb36461ff6d40c3bdd1c97350db745b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
import time | |
def calc_square(numbers): | |
print("calculate square numbers") | |
for n in numbers: | |
time.sleep(0.2) | |
print('square', n*n) | |
def calc_cube(numbers): | |
print("calculate cube numbers") | |
for n in numbers: | |
time.sleep(0.2) | |
print('cube', n*n) | |
arr = [2, 3, 8, 9] | |
t = time.time() | |
calc_square(arr) | |
calc_cube(arr) | |
print("done in: ", time.time() - t ) | |
print("Hah.. I am done with all my works now!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment