0

Не нашел, как вызвать функцию QueryPerformanceCounter. Пробовал так. Выдает ошибки, не знает, что такое BOOL и LARGE_INTEGER.

import core.sys.windows.windows;
import core.sys.windows.w32api;
import core.sys.windows.winbase;
pragma(lib, "kernel32");
extern (Windows)
{
    BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount);
}
void main()
{}

1 ответ 1

0
import core.sys.windows.winbase;
import core.sys.windows.windef;
import core.sys.windows.windows : QueryPerformanceCounter, QueryPerformanceFrequency;

void main()
{
    LARGE_INTEGER start, finish, freq;
    QueryPerformanceCounter(&start);
    //any long function
    QueryPerformanceCounter(&finish);
    QueryPerformanceFrequency(&freq);
}

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.