// Copyright (c) the JPEG XL Project Authors. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file.
double Now() { #if JXL_OS_WIN
LARGE_INTEGER counter;
(void)QueryPerformanceCounter(&counter);
LARGE_INTEGER freq;
(void)QueryPerformanceFrequency(&freq); returndouble(counter.QuadPart) / freq.QuadPart; #elif JXL_OS_MAC constauto t = mach_absolute_time(); // On OSX/iOS platform the elapsed time is cpu time unit // We have to query the time base information to convert it back // See https://developer.apple.com/library/mac/qa/qa1398/_index.html static mach_timebase_info_data_t timebase; if (timebase.denom == 0) {
(void)mach_timebase_info(&timebase);
} returndouble(t) * timebase.numer / timebase.denom * 1E-9; // notypo #elif JXL_OS_HAIKU returndouble(system_time_nsecs()) * 1E-9; #else
timespec t;
clock_gettime(CLOCK_MONOTONIC, &t); return t.tv_sec + t.tv_nsec * 1E-9; #endif
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.