Boost.Chrono: try to remove warnings

Test output: daw-msvc71 - chrono - test_clock_shared / msvc-7.1
Rev 68023 / Wed, 12 Jan 2011 02:00:50 +0000
Report Time: Wed, 12 Jan 2011 15:19:47 +0000

Compile [2011-01-12 07:20:48 UTC]: fail

    call "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat"  >nul
cl /Zm800 -nologo @"C:\boost_testing_trunk\results\boost\bin.v2\libs\chrono\test\test_clock_shared.test\msvc-7.1\debug\asynch-exceptions-on\threading-multi\test_clock.obj.rsp" 

test_clock.cpp
..\libs\chrono\test\..\example\test_clock.cpp(43) : error C2082: redefinition of formal parameter '__formal'
        ..\libs\chrono\test\..\example\test_clock.cpp(164) : see reference to function template instantiation 'void test_clock<boost::chrono::system_clock>(void)' being compiled
..\libs\chrono\test\..\example\test_clock.cpp(43) : error C2082: redefinition of formal parameter '__formal'
..\libs\chrono\test\..\example\test_clock.cpp(43) : error C2082: redefinition of formal parameter '__formal'
..\libs\chrono\test\..\example\test_clock.cpp(61) : warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
..\libs\chrono\test\..\example\test_clock.cpp(67) : warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
..\libs\chrono\test\..\example\test_clock.cpp(43) : error C2082: redefinition of formal parameter '__formal'
        ..\libs\chrono\test\..\example\test_clock.cpp(166) : see reference to function template instantiation 'void test_clock<boost::chrono::steady_clock>(void)' being compiled
..\libs\chrono\test\..\example\test_clock.cpp(43) : error C2082: redefinition of formal parameter '__formal'
..\libs\chrono\test\..\example\test_clock.cpp(43) : error C2082: redefinition of formal parameter '__formal'
..\libs\chrono\test\..\example\test_clock.cpp(61) : warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
..\libs\chrono\test\..\example\test_clock.cpp(67) : warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data


[SVN r68061]
This commit is contained in:
Vicente J. Botet Escriba 2011-01-12 17:58:45 +00:00
parent d7f8d996a5
commit 436ae2c780

View File

@ -53,18 +53,18 @@ void test_clock()
{
typename Clock::time_point start = Clock::now();
typename Clock::time_point stop;
std::size_t count=1;
std::size_t counter=1;
while ((stop=Clock::now()) == start) {
++count;
++counter;
}
//typename Clock::duration elapsed = stop - start;
std::cout << "After " << count << " trials, elapsed time " << nanoseconds(stop - start).count() << " nanoseconds\n";
std::cout << "After " << counter << " trials, elapsed time " << nanoseconds(stop - start).count() << " nanoseconds\n";
start = Clock::now();
for (std::size_t c=count; c>0; --c) {
for (std::size_t c=counter; c>0; --c) {
stop=Clock::now();;
}
std::cout << "After " << count << " trials, elapsed time " << nanoseconds(stop - start).count() << " nanoseconds\n";
std::cout << "After " << counter << " trials, elapsed time " << nanoseconds(stop - start).count() << " nanoseconds\n";
}