Groovy web console

subscribe to the feed Subscribe
to this


Published 3 months ago by vs
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
import groovy.time.TimeCategory
import groovy.time.TimeDuration

def root= new File('/usr/share')
def full= new File('/usr/share/docs/rpm-4.4')

Date start = new Date()
for (i in 1..10000){
  def relPath= new File( root.toURI().relativize( full.toURI() ).toString() )

Date stop = new Date()

td = TimeCategory.minus( stop, start )

print ("Took: ${td}")