Skip to content

Commit 5c35dda

Browse files
FIX: no auto types for chrono timepoints
Got some errors with clang... Co-authored-by: Amrita Goswami <amrita16thaug646@gmail.com>
1 parent ba654c7 commit 5c35dda

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

flowy/include/simulation.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Flowy
2424
*/
2525
struct SimulationState
2626
{
27-
std::chrono::time_point<std::chrono::system_clock> t_run_start{};
27+
std::chrono::time_point<std::chrono::high_resolution_clock> t_run_start{};
2828
std::vector<Lobe> lobes{};
2929

3030
int n_lobes_processed = 0;

src/simulation.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <fmt/format.h>
1717
#include <fmt/ranges.h>
1818
#include <algorithm>
19+
#include <chrono>
1920
#include <cmath>
2021
#include <cstddef>
2122
#include <memory>
@@ -345,7 +346,7 @@ Simulation::get_file_handle( const Topography & topography, OutputQuantity outpu
345346

346347
void Simulation::compute_topography_thickness()
347348
{
348-
// Compute the thickness by subtracting the initial topography and correcting for the thickening parametr
349+
// Compute the thickness by subtracting the initial topography and correcting for the thickening parameter
349350
topography_thickness = topography;
350351
topography_thickness.no_data_value = DEFAULT_NO_DATA_VALUE_THICKNESS;
351352
topography_thickness.height_data -= topography_initial.height_data;
@@ -497,7 +498,9 @@ void Simulation::post_flow_hook( int idx_flow, std::vector<Lobe> & lobes )
497498

498499
if( input.print_remaining_time )
499500
{
500-
const auto t_cur = std::chrono::high_resolution_clock::now();
501+
const std::chrono::time_point<std::chrono::high_resolution_clock> t_cur
502+
= std::chrono::high_resolution_clock::now();
503+
501504
const auto remaining_time = std::chrono::duration_cast<std::chrono::milliseconds>(
502505
( input.n_flows - idx_flow - 1 ) * ( t_cur - simulation_state->t_run_start ) / ( idx_flow + 1 ) );
503506
fmt::print( " remaining_time = {:%Hh %Mm %Ss}\n", remaining_time );

0 commit comments

Comments
 (0)