We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 11cf2c8 commit 48de264Copy full SHA for 48de264
extension/llm/runner/util.h
@@ -68,7 +68,13 @@ ET_EXPERIMENTAL void inline safe_printf(const char* piece) {
68
ET_EXPERIMENTAL long inline time_in_ms() {
69
// return time in milliseconds, for benchmarking the model speed
70
struct timespec time;
71
+ // The `timespec_get` function is only available on Android API levels
72
+ // 29 or later.
73
+#if defined(__ANDROID_API__) && __ANDROID_API__ < 29
74
clock_gettime(CLOCK_REALTIME, &time);
75
+#else
76
+ timespec_get(&time, TIME_UTC);
77
+#endif
78
return time.tv_sec * 1000 + time.tv_nsec / 1000000;
79
}
80
0 commit comments