Example #1
0
void measure_one(Sort& sort)
{
    auto start = system_clock::now();
    sort.sort();
    auto end = system_clock::now();
    
    std::string name = sort.name();
    std::stringstream name_ss;
    name_ss << std::setw(10) << std::left << name;
    //name_ss << name << std::setw(10);
    if ( sort.check() ) {
	auto duration = duration_cast<milliseconds>(end-start).count();
	std::stringstream time_ss;
	time_ss << std::setw(12) << duration;
	std::cout << name_ss.str() << ": " << time_ss.str() << "[ms]" << std::endl;
    } else {
	// failure
	std::cout << name_ss.str() << ": sort failed" << std::endl;
    }
}
Example #2
0
void List_C::sort() {
    sort_function->sort(this);
}
Example #3
0
void Vector_C::sort() {
    sort_function->sort(this);
}