jeudi 12 juillet 2018

Ruby Date Time Subtraction

I am trying to calculate the exact duration a process took from some log file result. After parsing the log, I reached at the following stage:

my_array = ["Some_xyz_process", "Start", "2018-07-12", "12:59:53,397", "End", "2018-07-12", "12:59:55,913"]
puts my_array

Some_xyz_process
Start
2018-07-12
12:59:53,397
End
2018-07-12
12:59:55,913

How can I subtract the start date and time with the end date and time in order to retrieve the exact duration the process took?

Aucun commentaire:

Enregistrer un commentaire