clock
Материал из cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Заголовочный файл <time.h>
|
||
Возвращает приблизительное время процессора, используемого в процессе с начала реализации определенной эпохи, связанные с исполнением программы. Для преобразования результата значение в секундах разделить его на CLOCKS_PER_SEC. Потому что в начале clock эпоху не должны совпадать с начала программы, только разница между двумя значениями возвращаются различных вызовов clock имеет смысл. Если процессор совместно с другими процессами, clock время может продвигаться медленнее, чем настенные часы. Если текущий процесс является многопоточной и более одного выполнение основных доступно, clock время может продвигаться быстрее, чем настенные часы.
Original:
Returns the approximate processor time used by the process since the beginning of an implementation-defined era related to the program's execution. To convert result value to seconds divide it by CLOCKS_PER_SEC. Because the beginning of the clock era does not have to coincide with the start of the program, only the difference between two values returned by different calls to clock is meaningful. If the CPU is shared by other processes, clock time may advance slower than wall clock. If the current process is multithreaded and more than one execution core is available, clock time may advance faster than wall clock.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Содержание |
[править] Параметры
(Нет)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[править] Возвращаемое значение
Процессор время используется программа до сих пор или (clock_t)(-1) если эта информация остается недоступным.
Original:
Processor time used by the program so far or (clock_t)(-1) if that information is unavailable.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[править] Notes
В POSIX-совместимых систем, clock_gettime с тактовой ID CLOCK_PROCESS_CPUTIME_ID предлагает лучшее решение.
Original:
On POSIX-compatible systems, clock_gettime with clock id CLOCK_PROCESS_CPUTIME_ID offers better resolution.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Значение, возвращаемое
clock() может обернуть вокруг некоторых реализациях. Например, на компьютере с 32-разрядной clock_t, он обертывает после 2147 секунд или 36 минут.Original:
The value returned by
clock() may wrap around on some implementations. For example, on a machine with 32-bit clock_t, it wraps after 2147 seconds or 36 minutes.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
clock() не обязан быть поточно-.Original:
clock() is not required to be thread-safe.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[править] Пример
| Этот раздел не завершён Причина: нет примера |
[править] См. также
| преобразует tm объекта в текстовое представлениеOriginal: converts a tm object to a textual representationThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (функция) | |
| возвращает текущее время системы как раз с эпохой Original: returns the current time of the system as time since epoch The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (функция) | |
| C++ документация для clock
| |