Windows VC++

#pragma comment(lib, "rpcrt4.lib")
#include <iostream>
#include <chrono>
#include <fstream>
#include <iostream>
#include <limits.h>
#include <sstream>
#include <string>
#include <Windows.h>

using namespace std;
void testTime(); 

int main()
{         
    testTime();
    cin.get();
} 

void testTime()
{
    for (int j = 0;j < 10;j++)
    {
        auto startTime = chrono::system_clock::now();
        for (int i = 0; i < 100000000; i++)
        {
            UUID uuid;
            UuidCreate(&uuid);
        }
        auto endTime = chrono::system_clock::now(); 
        cout << j << ","<< chrono::duration_cast<chrono::milliseconds>(endTime - startTime).count() 
            << " milliseconds" << endl;
    }
}

 

posted @ 2022-07-26 22:54  FredGrit  阅读(31)  评论(0编辑  收藏  举报