We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e409f3 commit 5d7f879Copy full SHA for 5d7f879
speedup_test.py
@@ -1,11 +1,12 @@
1
from src.acoustipy.TMM import AcousticTMM
2
import time
3
+import timeit
4
5
times = []
6
# Create an AcousticTMM object, specifying a diffuse sound field at 20C
7
for i in range(100):
- s = time.time()
8
- structure = AcousticTMM(incidence='Diffuse',air_temperature=20, device='cpu')
+ s = timeit.default_timer()
9
+ structure = AcousticTMM(incidence='Diffuse',air_temperature=20, device='cuda')
10
11
# Define the layers of the material using various models
12
layer1 = structure.Add_Resistive_Screen(thickness=1,flow_resistivity=100000,porosity=.86)
@@ -26,7 +27,7 @@
26
27
28
# Calculate the four frequency average absorption
29
FFA = structure.FFA(bands)
- t = time.time()-s
30
+ t = timeit.default_timer() - s
31
print(t)
32
times.append(t)
33
0 commit comments