Skip to content

Commit f2baef4

Browse files
committed
Add wall_time
1 parent 8efa53c commit f2baef4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

examples/batch_pilot.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ let
281281
results = Tuple{String, SimulationError}[]
282282
av_powers = Float64[]
283283
for project in PROJECTS
284+
wall_start_ns = time_ns()
284285
println("Running project $project ...")
285286
app = KiteApp(deepcopy(load_settings(project)), 0.0,
286287
nothing, nothing, nothing, nothing, nothing, nothing, nothing,
@@ -309,6 +310,7 @@ let
309310
println("\nSaving log to output/$(output_name).arrow ($(app.logger.index) entries) ...")
310311
save_log(app.logger::Logger, output_name; path = output_path)
311312
end
313+
wall_time = (time_ns() - wall_start_ns) / 1e9
312314
stats = calc_stats(app.logger)
313315
fmt(x) = @sprintf("%10.2f", x)
314316
v_wind_200 = app.set.v_wind * calc_wind_factor(app.kps4.am, 200.0)
@@ -317,6 +319,7 @@ let
317319
project: "$(project)"
318320
timestamp: "$(timestamp)"
319321
duration: $(fmt(steps * app.dt)) # simulated duration [s]
322+
wall_time: $(fmt(wall_time)) # elapsed wall-clock time for setup/sim/save [s]
320323
v_wind_200: $(fmt(v_wind_200)) # wind speed at 200m height [m/s]
321324
error:
322325
code: "$(error.code)"

0 commit comments

Comments
 (0)