Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6579

Groovy Console not responsive when running the closure.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2.1
    • Fix Version/s: None
    • Component/s: Groovy Console
    • Labels:
      None
    • Environment:
      Windows XP, Groovy Version 2.2.1, JDK 1.7.0_40

      Description

      Please refer to below code. When I run it in groovyconsole, the console hangs indefinitely. If there is a better way to write this construct please advice.

      def benchmark(repeat, Closure worker) {
          start = System.currentTimeMillis()
          repeat.times{println it}
          stop = System.currentTimeMillis()
          return stop - start
      }
      
      slow = benchmark(10000) {it}
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sriharshareddyk skis
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: