Stefans Implementierung der Closure


/ Published in: Groovy
Save to your folder(s)



Copy this code and paste it in your HTML
  1. def timeLogged (Closure c) {
  2. long start = - System.currentTimeMillis()
  3. c.call()
  4. println "duration in sec: " + (System.currentTimeMillis() + start) / 1000;
  5. }

URL: http://berndschiffer.blogspot.com/2009/08/beispiel-fur-refactoring-von-beispiel.html

Report this snippet


Comments


You need to login to view comments.