2017-08-04 19:38:25 +00:00
|
|
|
package net.shadowfacts.ekt
|
|
|
|
|
|
|
|
import java.io.File
|
2017-10-07 19:36:22 +00:00
|
|
|
import java.lang.management.ManagementFactory
|
2017-08-30 23:35:26 +00:00
|
|
|
import kotlin.concurrent.thread
|
2017-08-04 19:38:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author shadowfacts
|
|
|
|
*/
|
|
|
|
fun main(args: Array<String>) {
|
2017-10-07 19:36:22 +00:00
|
|
|
println(ManagementFactory.getRuntimeMXBean().name)
|
|
|
|
|
|
|
|
for (i in 0..99) {
|
|
|
|
println("Rendering $i")
|
|
|
|
render()
|
2017-08-05 17:41:24 +00:00
|
|
|
}
|
2017-10-07 19:36:22 +00:00
|
|
|
|
|
|
|
println("done")
|
|
|
|
|
|
|
|
// thread {
|
|
|
|
// for (i in 0..30) {
|
|
|
|
// println("Thread 1 iteration $i")
|
|
|
|
// render()
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// thread {
|
|
|
|
// for (i in 0..30) {
|
|
|
|
// println("Thread 2 iteration $i")
|
|
|
|
// render()
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// thread {
|
|
|
|
// for (i in 0..30) {
|
|
|
|
// println("Thread 3 iteration $i")
|
|
|
|
// render()
|
|
|
|
// }
|
|
|
|
// }
|
2017-08-30 23:35:26 +00:00
|
|
|
}
|
2017-08-04 19:38:25 +00:00
|
|
|
|
2017-08-30 23:35:26 +00:00
|
|
|
fun render(): String {
|
2017-10-07 19:36:22 +00:00
|
|
|
return EKT.renderClasspath("template", "/templates", cacheDir = File("cache")) {
|
2017-08-30 23:35:26 +00:00
|
|
|
"list" to (listOf(1, 2, 3) asType "List<Int>")
|
2017-08-04 19:38:25 +00:00
|
|
|
}
|
|
|
|
}
|