Skip to content

Commit

Permalink
week 07 correction
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmetanildindar committed Apr 21, 2021
1 parent a30715c commit 6fffeb0
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions CE302-Week07.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,19 @@ def random_squared( seed ):
return random_num ** 2
# %%

rakam = 100_000
rakam = 1_000

# %%
timeSerial = pd.Dataframe(columns=["Rakam","TimeElapsed"])
timeSerial = pd.DataFrame(columns=["Rakam","TimeElapsed"])

if __name__ == "__main__" :

t0 = time.time()

results = []
results1 = []

for i in range( rakam ):
results.append( random_squared(i) ) ;
results1.append( random_squared(i) ) ;

t1 = time.time()
timeElapsed = round( t1-t0 , 3)
Expand All @@ -48,15 +49,13 @@ def random_squared( seed ):
if __name__ == "__main__" :




t0 = time.time()

n_cpu = mp.cpu_count()

pool = mp.Pool( processes= 4 , )

results = [ pool.map( random_squared , range(rakam))]
results2 = [ pool.map( random_squared , range(rakam))]

t1 = time.time()

Expand Down

0 comments on commit 6fffeb0

Please sign in to comment.