Skip to content

Instantly share code, notes, and snippets.

@jpokrzyk
Created July 8, 2014 21:28
Show Gist options
  • Save jpokrzyk/ab5602810cb61323c149 to your computer and use it in GitHub Desktop.
Save jpokrzyk/ab5602810cb61323c149 to your computer and use it in GitHub Desktop.
Timer with java spark
package com.carematics
import static spark.Spark.*
import spark.*
setPort(80)
get new Route('/') {
def handle(Request request, Response response) {
return 'hi jon'
}
}
def count = 0
new Timer().schedule({
println count++
} as TimerTask, 1000, 3000) //magic numbers are initial-delay & repeat-interval
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment