X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=dyncnn.git;a=blobdiff_plain;f=flatland.cc;h=075e073aba0a3a4b89af4ad31b2897cecb5660cf;hp=75e986282aff94e82c4c94fcc7a72c62d7341a2f;hb=d84867d9fde82f49fa0b4545d8eb763f997d31ea;hpb=5cbea5ca8a26719be70c974fab505e5b8695d9e4 diff --git a/flatland.cc b/flatland.cc index 75e9862..075e073 100644 --- a/flatland.cc +++ b/flatland.cc @@ -31,6 +31,7 @@ #include #include #include +#include using namespace std; @@ -191,6 +192,10 @@ int main(int argc, char **argv) { abort(); } + struct timeval start_time, current_time; + + gettimeofday(&start_time, 0); + for(int n = 0; n < nb_sequences; n++) { Universe *universe; @@ -217,10 +222,16 @@ int main(int argc, char **argv) { } if((n+1)%100 == 0) { + gettimeofday(¤t_time, 0); + int estimated_remaining_time = + ((nb_sequences - n) * (current_time.tv_sec - start_time.tv_sec)) / n; cout << "Created " << n+1 << "/" << nb_sequences << " sequences in " << data_dir - << "." << endl; + << " (~" + << estimated_remaining_time/60 << "min" + << estimated_remaining_time%60 << "s remaining)." + << endl; } do {