Skip to content

Commit

Permalink
TickDuration.nextTick
Browse files Browse the repository at this point in the history
  • Loading branch information
andantet committed Nov 17, 2023
1 parent 43fb4ca commit 1be3f0e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kotlin.code.style=official

project_version=0.1.2
project_version=0.1.3
maven_group=net.mcbrawls

kotlin_version=1.9.20
Expand Down
13 changes: 13 additions & 0 deletions src/main/kotlin/net/mcbrawls/scheduler/duration/TickDuration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,17 @@ object TickDuration {
val nanosPerTick = 1_000_000_000L / ticksPerSecond
return nanos / nanosPerTick
}

/**
* Creates a tick duration for a single tick.
* @return a duration
*/
fun nextTick(
/**
* The amount of ticks which comprise a second.
*/
ticksPerSecond: Long = 20
): Duration {
return create(1, ticksPerSecond)
}
}

0 comments on commit 1be3f0e

Please sign in to comment.