From 9f239fa72f85d76ddbd07a2f1ad0c20c949461e5 Mon Sep 17 00:00:00 2001 From: lisonge Date: Sat, 20 Jan 2024 13:50:31 +0800 Subject: [PATCH] perf: useThrottle 500L --- app/src/main/kotlin/li/songe/gkd/util/TimeExt.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/li/songe/gkd/util/TimeExt.kt b/app/src/main/kotlin/li/songe/gkd/util/TimeExt.kt index 1d1115cbf..7c52614cb 100644 --- a/app/src/main/kotlin/li/songe/gkd/util/TimeExt.kt +++ b/app/src/main/kotlin/li/songe/gkd/util/TimeExt.kt @@ -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()