Skip to content

Commit 5d7f879

Browse files
author
jacpeterson
committed
mod speed test
1 parent 4e409f3 commit 5d7f879

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

speedup_test.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
from src.acoustipy.TMM import AcousticTMM
22
import time
3+
import timeit
34

45
times = []
56
# Create an AcousticTMM object, specifying a diffuse sound field at 20C
67
for i in range(100):
7-
s = time.time()
8-
structure = AcousticTMM(incidence='Diffuse',air_temperature=20, device='cpu')
8+
s = timeit.default_timer()
9+
structure = AcousticTMM(incidence='Diffuse',air_temperature=20, device='cuda')
910

1011
# Define the layers of the material using various models
1112
layer1 = structure.Add_Resistive_Screen(thickness=1,flow_resistivity=100000,porosity=.86)
@@ -26,7 +27,7 @@
2627

2728
# Calculate the four frequency average absorption
2829
FFA = structure.FFA(bands)
29-
t = time.time()-s
30+
t = timeit.default_timer() - s
3031
print(t)
3132
times.append(t)
3233

0 commit comments

Comments
 (0)