Skip to content
Snippets Groups Projects
Commit 033d9e0f authored by Riccardo Boero's avatar Riccardo Boero :innocent:
Browse files

fixed task duration function

parent d1034c31
No related branches found
No related tags found
No related merge requests found
......@@ -55,9 +55,7 @@ function run_task(task_name::String, task_info::Dict, dependencies_info::Dict,
println("Completed task $task_name at $(Dates.format(end_time, "HH:MM:SS"))")
# Calculate and print the duration
duration = end_time - start_time # Duration as a Period type
println(Dates.value(duration))
duration = print_duration_in_hms(duration) # Duration as a Period type
duration = print_duration_in_hms(end_time - start_time) # Duration as a String interpretation of a Period type
println("Duration of task $task_name: $duration")
end
......@@ -243,7 +241,8 @@ function get_task_df(task_name::String, dependencies_info::Dict, results_contain
end
function print_duration_in_hms(duration::Period)
total_seconds = Dates.value(duration) # Get total seconds from the duration
total_milliseconds = Dates.value(duration) # Get total milliseconds from the duration
total_seconds = div(total_milliseconds, 1000) # Convert milliseconds to seconds
hours = total_seconds ÷ 3600 # Integer division to get hours
minutes = (total_seconds % 3600) ÷ 60 # Remaining minutes
seconds = total_seconds % 60 # Remaining seconds
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment