Skip to content

Instantly share code, notes, and snippets.

View maduraimad's full-sized avatar

Arthi M Krishna maduraimad

  • The United States Patent and Trademark Office
View GitHub Profile
@maduraimad
maduraimad / timeIt.groovy
Last active September 27, 2018 12:52 — forked from bdkosher/timeIt.groovy
def timeIt = { resultFormatter = { obj -> obj?.toString() }, closure ->
def start = System.nanoTime()
def result = null
try {
result = closure()
} catch (Exception e) {
result = e
}
def end = System.nanoTime()
def ms = (end - start) / 1e6