|
|
Hi folks,
can a few of you folks please run the following little program on your
computers and report the time it takes to run?
--------------------------------------------------
#include <chrono>
#include <thread>
#include <iostream>
inline void Delay(unsigned int msec)
{
std::this_thread::sleep_for(std::chrono::milliseconds(msec));
}
int main()
{
int count = 1000;
for (int i = 0; i < count; ++i)
{
Delay(1);
}
std::cout << "Done." << std::endl;
}
--------------------------------------------------
On Windows Subsystem For Linux I see results like the following:
real 0m1.782s
user 0m0.000s
sys 0m0.000s
But as I presume this is using the Windows scheduler, I expect that
genuine Linux systems may behave differently, and I'm also interested in
other platforms (Mac, maybe BSD if some of you folks are using that, or
actually any system you can get your hands on.)
I have also reason to believe that results may differ between compilers.
Using g++ 5.4.0 here.
Post a reply to this message
|
|