summaryrefslogtreecommitdiff
path: root/opendc-experiments
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-experiments')
-rw-r--r--opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt
index d2105196..90350142 100644
--- a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt
+++ b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt
@@ -39,6 +39,7 @@ import java.util.*
import kotlin.coroutines.Continuation
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.resume
+import kotlin.math.ceil
import kotlin.math.roundToLong
/**
@@ -137,7 +138,7 @@ public class SimTFDevice(
if (activeWork.consume(consumedWork)) {
this.activeWork = null
} else {
- val duration = (activeWork.flops / conn.capacity * 1000).roundToLong()
+ val duration = ceil(activeWork.flops / conn.capacity * 1000).toLong()
conn.push(conn.capacity)
return duration
}