mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[yul-phaser] AlgorithmRunner: Print total time when showing only the top chromosome
This commit is contained in:
parent
58e3fca3de
commit
10e8d3616c
@ -84,7 +84,7 @@ protected:
|
|||||||
string topChromosomePattern(size_t roundNumber, Individual const& individual) const
|
string topChromosomePattern(size_t roundNumber, Individual const& individual) const
|
||||||
{
|
{
|
||||||
ostringstream output;
|
ostringstream output;
|
||||||
output << roundNumber << "\\|" << individualPattern(individual);
|
output << roundNumber << R"(\|[0-9.]+\|)" << individualPattern(individual);
|
||||||
return output.str();
|
return output.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,15 +54,15 @@ void AlgorithmRunner::printRoundSummary(
|
|||||||
clock_t _roundTimeStart,
|
clock_t _roundTimeStart,
|
||||||
clock_t _totalTimeStart
|
clock_t _totalTimeStart
|
||||||
) const
|
) const
|
||||||
{
|
|
||||||
if (!m_options.showOnlyTopChromosome)
|
|
||||||
{
|
|
||||||
if (m_options.showRoundInfo)
|
|
||||||
{
|
{
|
||||||
clock_t now = clock();
|
clock_t now = clock();
|
||||||
double roundTime = static_cast<double>(now - _roundTimeStart) / CLOCKS_PER_SEC;
|
double roundTime = static_cast<double>(now - _roundTimeStart) / CLOCKS_PER_SEC;
|
||||||
double totalTime = static_cast<double>(now - _totalTimeStart) / CLOCKS_PER_SEC;
|
double totalTime = static_cast<double>(now - _totalTimeStart) / CLOCKS_PER_SEC;
|
||||||
|
|
||||||
|
if (!m_options.showOnlyTopChromosome)
|
||||||
|
{
|
||||||
|
if (m_options.showRoundInfo)
|
||||||
|
{
|
||||||
m_outputStream << "---------- ROUND " << _round + 1;
|
m_outputStream << "---------- ROUND " << _round + 1;
|
||||||
m_outputStream << " [round: " << fixed << setprecision(1) << roundTime << " s,";
|
m_outputStream << " [round: " << fixed << setprecision(1) << roundTime << " s,";
|
||||||
m_outputStream << " total: " << fixed << setprecision(1) << totalTime << " s]";
|
m_outputStream << " total: " << fixed << setprecision(1) << totalTime << " s]";
|
||||||
@ -76,7 +76,10 @@ void AlgorithmRunner::printRoundSummary(
|
|||||||
else if (m_population.individuals().size() > 0)
|
else if (m_population.individuals().size() > 0)
|
||||||
{
|
{
|
||||||
if (m_options.showRoundInfo)
|
if (m_options.showRoundInfo)
|
||||||
|
{
|
||||||
m_outputStream << setw(5) << _round + 1 << " | ";
|
m_outputStream << setw(5) << _round + 1 << " | ";
|
||||||
|
m_outputStream << setw(5) << fixed << setprecision(1) << totalTime << " | ";
|
||||||
|
}
|
||||||
|
|
||||||
m_outputStream << m_population.individuals()[0] << endl;
|
m_outputStream << m_population.individuals()[0] << endl;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user