I am trying to calculate difference between times required to perform specific tasks. For example,
Date startpipeline = new Date()
// ...task 1...
Date stoppipeline = new Date()
TimeDuration task1 = TimeCategory.minus( stoppipeline, startpipeline )
print "time taken by task1 is " + task1
By doing above I am getting proper out as 5 mins, 23 secs
etc. Similarly
Date startpipeline2 = new Date()
// ...task2...
Date stoppipeline2 = new Date()
TimeDuration task2 = TimeCategory.minus( stoppipeline2, startpipeline2 )
print "time taken by task2 is " + task2
By doing above I am getting proper out as 2 mins, 23 secs
etc.
But for some requirement i need to calculate difference between both the task I tried doing
TimeDuration diffbetween2task = TimeCategory.minus( task1, task2 )
but it gives an error. It expects task1 and task2 as date format. Can someone please help?