Skip to content

Commit

Permalink
added timing
Browse files Browse the repository at this point in the history
  • Loading branch information
benmaier committed Jul 3, 2021
1 parent 5b1e9ae commit 1757ef7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion binpacking/to_constant_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ def to_constant_volume(d,V_max,weight_pos=None,key=None,lower_bound=None,upper_b

import matplotlib.pyplot as pl
pl.plot(np.arange(len(w)),w)
pl.show()


b = { 'a': 10, 'b': 10, 'c':11, 'd':1, 'e': 2,'f':7 }
Expand All @@ -170,4 +169,12 @@ def to_constant_volume(d,V_max,weight_pos=None,key=None,lower_bound=None,upper_b
bins = to_constant_volume(b,V_max)
print(bins)

import time
start = time.time()
for i in range(100):
bins = to_constant_volume(a,V_max)
end = time.time()
print("needed", end-start, "sec")


pl.show()

0 comments on commit 1757ef7

Please sign in to comment.