Skip to content

Commit

Permalink
refactor: make startTime a local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
wzieba committed Dec 1, 2023
1 parent 0a526b5 commit d282f8b
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,13 @@ internal class EngagementManager(
) {
private var job: Job? = null
private var totalTime: Long = 0
private var startTime: Duration
private var nextScheduledExecution: Long = 0

init {
startTime = clock.now
}

val isRunning: Boolean
get() = job?.isActive ?: false

fun start() {
startTime = clock.now
val startTime = clock.now
job = coroutineScope.launch {
while (isActive) {
latestDelayMillis = intervalCalculator.calculate(startTime)
Expand Down

0 comments on commit d282f8b

Please sign in to comment.