Skip to content

Commit bc6684a

Browse files
Di Xu (SWE)facebook-github-bot
authored andcommitted
Fix timespec_get not compatiable for AOSP OS Android N14 (#10240)
Summary: timespec_get was introduced in the pull request D72181347 for the windows time count. The MARCO gate was for ANDROID_API < 29, however, some other AOSP based OS does not support this function too Reviewed By: larryliu0820 Differential Revision: D73136434
1 parent 47fb157 commit bc6684a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

extension/llm/runner/util.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ ET_EXPERIMENTAL void inline safe_printf(const char* piece) {
6868
ET_EXPERIMENTAL long inline time_in_ms() {
6969
// return time in milliseconds, for benchmarking the model speed
7070
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
71+
// The `timespec_get` function is for windows time access. Some AOSP OS does
72+
// not have timespec_get support.
73+
#if defined(__ANDROID_API__)
7474
clock_gettime(CLOCK_REALTIME, &time);
7575
#else
7676
timespec_get(&time, TIME_UTC);

0 commit comments

Comments
 (0)