Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,14 @@ class PluginInstance(val instanceName: String, pluginType: PluginType) extends W
// Execute loop, if an interval is set
if (plugin.get.getLoopInterval > 0) {
while (!threadStopAfterNextIteration) {
val startTime = System.currentTimeMillis()

plugin.get.loop()
Thread.sleep(plugin.get.getLoopInterval)

val execTime = System.currentTimeMillis() - startTime
val sleepTime = plugin.get.getLoopInterval - execTime
if (sleepTime > 0)
Thread.sleep(sleepTime)
}
}

Expand Down