Esempio n. 1
0
int main()
{
	int Error = 0;

	Error += test_std_copy();
	Error += test_vec2_cast();
	Error += test_vec3_cast();
	Error += test_vec4_cast();

	return Error;
}
Esempio n. 2
0
File: main.cpp Progetto: CCJY/coliru
int main()
{
    srand(time(0));

    // The counter is introduced to prevent the compiler
    // from optimizating *everything* away.
    unsigned counter = 0;

    // Print the times for the different strategies.
    print_time(test_std_copy(), counter);
    print_time(test_memmove(),  counter);
    print_time(test_memcpy(),   counter);
    print_time(test_cast(),     counter);

    // Printing the counter to stdout prevents the compiler from
    // optimizing away the inner loop of the benchmark function.
    std::cout << "(counter:  " << counter << ")" << std::endl << std::endl;

}