while only runs if its true
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
89504a99ca
commit
d81339b851
@ -17,7 +17,7 @@ fun Application.module(testing: Boolean = false) {
|
|||||||
runBlocking {
|
runBlocking {
|
||||||
val cachedFile = File("/app/wave.wav").readBytes()
|
val cachedFile = File("/app/wave.wav").readBytes()
|
||||||
val gson = GsonBuilder().setPrettyPrinting().create()
|
val gson = GsonBuilder().setPrettyPrinting().create()
|
||||||
val startTime = Instant.now()
|
var startTime : Instant
|
||||||
var elapsed = Duration.ofSeconds(0)
|
var elapsed = Duration.ofSeconds(0)
|
||||||
val targetTime = Duration.ofSeconds(System.getenv("WAITTIME").toLong())
|
val targetTime = Duration.ofSeconds(System.getenv("WAITTIME").toLong())
|
||||||
var currIter = 1
|
var currIter = 1
|
||||||
@ -29,7 +29,8 @@ fun Application.module(testing: Boolean = false) {
|
|||||||
val job = GlobalScope.launch {
|
val job = GlobalScope.launch {
|
||||||
delay(3000L)
|
delay(3000L)
|
||||||
println("Starting benchmark")
|
println("Starting benchmark")
|
||||||
while(elapsed > targetTime){
|
startTime = Instant.now()
|
||||||
|
while(elapsed < targetTime){
|
||||||
println(currIter)
|
println(currIter)
|
||||||
uploader.uploadData(currIter, gson, cachedFile)
|
uploader.uploadData(currIter, gson, cachedFile)
|
||||||
currIter+=1
|
currIter+=1
|
||||||
|
Loading…
Reference in New Issue
Block a user