summaryrefslogtreecommitdiff
path: root/opendc
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2020-02-14 13:26:20 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-02-14 13:26:20 +0100
commitb13ba01e967e1a281d58b37cb57986b47ec99dd8 (patch)
tree716253f4c03cf8dc6754430a5f63d0a57061d795 /opendc
parentbaeb118d68747e58f1c1beb8b2d27e1d640827f4 (diff)
bug: Apply requested cpu time correctly
This change fixes an issue where the runtime of an image that requested cpu time was not properly computed.
Diffstat (limited to 'opendc')
-rw-r--r--opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/metal/driver/SimpleBareMetalDriver.kt2
1 files changed, 1 insertions, 1 deletions
diff --git a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/metal/driver/SimpleBareMetalDriver.kt b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/metal/driver/SimpleBareMetalDriver.kt
index 4ccb6c57..4c702ffa 100644
--- a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/metal/driver/SimpleBareMetalDriver.kt
+++ b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/metal/driver/SimpleBareMetalDriver.kt
@@ -138,7 +138,7 @@ public class SimpleBareMetalDriver(
override suspend fun run(req: LongArray) {
// TODO Properly implement this for multiple CPUs
- val time = max(0, req.max() ?: 0) * flavor.cpus[0].clockRate
+ val time = max(0, req.max() ?: 0) / (flavor.cpus[0].clockRate * 1000)
delay(time.toLong())
}
}