@Miltonc

I want to find the time it will take to sort through an insertion sort in c++?

I want to ask a user to enter 10 random numbers. The program will sort through this array of numbers using insertion sort. The program will then display the sorted array and the time it took to sort the array in c++.
  • Вопрос задан
  • 90 просмотров
Решения вопроса 1
myjcom
@myjcom Куратор тега C++
auto t1 = std::chrono::high_resolution_clock::now();
f();
auto t2 = std::chrono::high_resolution_clock::now();


Examples
https://en.cppreference.com/w/cpp/chrono/high_reso...
FROM -----> https://en.cppreference.com/w/cpp/chrono/duration/...
https://en.cppreference.com/w/cpp/chrono/c/difftime
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы