更新
This commit is contained in:
16
Python-100-Days/Day01-15/Day13/multiprocess4.py
Normal file
16
Python-100-Days/Day01-15/Day13/multiprocess4.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from time import time
|
||||
|
||||
|
||||
def main():
|
||||
total = 0
|
||||
number_list = [x for x in range(1, 100000001)]
|
||||
start = time()
|
||||
for number in number_list:
|
||||
total += number
|
||||
print(total)
|
||||
end = time()
|
||||
print('Execution time: %.3fs' % (end - start))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user