new formatter
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2020-10-21 19:30:44 +02:00
parent 701f51a334
commit 860bd29ec2
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047
2 changed files with 9 additions and 5 deletions

View File

@ -7,7 +7,7 @@ fun main() = runBlocking{
GlobalScope.launch {
val mqtt = MqttSubscriber()
mqtt.connect()
val waitTime = System.getenv("WAITTIME").toLong() ?: 10000L
val waitTime = System.getenv("WAITTIME").toLong()
delay(waitTime)
val resultMap = mqtt.disconnect()
val resultProcessor = ProcessResults()

View File

@ -1,14 +1,18 @@
import java.text.SimpleDateFormat
import java.time.Instant
import java.time.ZoneId
import java.time.format.DateTimeFormatter
class ProcessResults{
class ProcessResults {
var mapToProcess = LinkedHashMap<Int, Instant>()
private var formatter = SimpleDateFormat("yyyy-MM-dd_HH-mm-ss_SSS")
private var formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss_SSS")
.withZone(ZoneId.systemDefault())
fun process(){
for((id, instant) in this.mapToProcess){
fun process() {
println("Start processing results")
for ((id, instant) in this.mapToProcess) {
val currInstantString = formatter.format(instant)
println("$id, $currInstantString")
}