This commit is contained in:
parent
9663660519
commit
567f8a8d24
@ -16,6 +16,7 @@ fun main(args: Array<String>): Unit = io.ktor.server.tomcat.EngineMain.main(args
|
|||||||
fun Application.module(testing: Boolean = false) {
|
fun Application.module(testing: Boolean = false) {
|
||||||
runBlocking {
|
runBlocking {
|
||||||
var startTime: Instant
|
var startTime: Instant
|
||||||
|
var currTimeStamp: Instant
|
||||||
var elapsed = Duration.ZERO
|
var elapsed = Duration.ZERO
|
||||||
val targetTime = Duration.ofSeconds(System.getenv("WAITTIME").toLong())
|
val targetTime = Duration.ofSeconds(System.getenv("WAITTIME").toLong())
|
||||||
var currIter = 0
|
var currIter = 0
|
||||||
@ -29,6 +30,8 @@ fun Application.module(testing: Boolean = false) {
|
|||||||
while (elapsed < targetTime) {
|
while (elapsed < targetTime) {
|
||||||
currIter += 1
|
currIter += 1
|
||||||
uploaders.add(Uploader(currIter))
|
uploaders.add(Uploader(currIter))
|
||||||
|
currTimeStamp = Instant.now()
|
||||||
|
elapsed = Duration.between(startTime, currTimeStamp)
|
||||||
}
|
}
|
||||||
for (uploader in uploaders) {
|
for (uploader in uploaders) {
|
||||||
uploader.sendRequest()
|
uploader.sendRequest()
|
||||||
|
Loading…
Reference in New Issue
Block a user