Skip to content

Commit

Permalink
perf: useThrottle 500L
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Jan 20, 2024
1 parent 2ba1292 commit 9f239fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/kotlin/li/songe/gkd/util/TimeExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fun Long.format(formatStr: String): String {
return df.format(this)
}

fun useThrottle(interval: Long = 1000L): (fn: () -> Unit) -> Unit {
fun useThrottle(interval: Long = 500L): (fn: () -> Unit) -> Unit {
var lastTriggerTime = 0L
return { fn ->
val t = System.currentTimeMillis()
Expand Down

0 comments on commit 9f239fa

Please sign in to comment.