projects
/
dyncnn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
5cbea5c
)
Prints the estimated remaining time.
author
Francois Fleuret
<francois@fleuret.org>
Mon, 26 Dec 2016 10:19:22 +0000
(11:19 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Mon, 26 Dec 2016 10:19:22 +0000
(11:19 +0100)
flatland.cc
patch
|
blob
|
history
diff --git
a/flatland.cc
b/flatland.cc
index
75e9862
..
075e073
100644
(file)
--- a/
flatland.cc
+++ b/
flatland.cc
@@
-31,6
+31,7
@@
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
+#include <sys/time.h>
using namespace std;
using namespace std;
@@
-191,6
+192,10
@@
int main(int argc, char **argv) {
abort();
}
abort();
}
+ struct timeval start_time, current_time;
+
+ gettimeofday(&start_time, 0);
+
for(int n = 0; n < nb_sequences; n++) {
Universe *universe;
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) {
}
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
cout << "Created "
<< n+1 << "/" << nb_sequences << " sequences in "
<< data_dir
- << "." << endl;
+ << " (~"
+ << estimated_remaining_time/60 << "min"
+ << estimated_remaining_time%60 << "s remaining)."
+ << endl;
}
do {
}
do {