Last active
May 24, 2019 11:46
-
-
Save zviederi/0b4a03885f1251e342f07070a7f9c155 to your computer and use it in GitHub Desktop.
How to calculate elapsed/duration time in Groovy/Grails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.time.TimeCategory | |
import groovy.time.TimeDuration | |
def timeStart = new Date() | |
// do something here | |
def timeStop = new Date() | |
TimeDuration duration = TimeCategory.minus(timeStop, timeStart) | |
println duration |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment