Add some end time estimation code to keep myself entertained while I wait
for the program to finish.
This commit is contained in:
parent
9c43f4785e
commit
eea57f81b8
2 changed files with 15 additions and 3 deletions
|
@ -8,7 +8,7 @@ tgvpf_LDADD = \
|
||||||
$(top_builddir)/src/Lib/poly2tri/libpoly2tri.a \
|
$(top_builddir)/src/Lib/poly2tri/libpoly2tri.a \
|
||||||
$(top_builddir)/src/Lib/TriangleJRS/libTriangleJRS.a \
|
$(top_builddir)/src/Lib/TriangleJRS/libTriangleJRS.a \
|
||||||
$(top_builddir)/src/Lib/vpf/libvpf.a \
|
$(top_builddir)/src/Lib/vpf/libvpf.a \
|
||||||
-lsgdebug -lsgbucket -lsgmisc -lsgmath -lsgio -lsgstructure -lsgxml \
|
-lsgdebug -lsgbucket -lsgmisc -lsgmath -lsgio -lsgtiming -lsgstructure -lsgxml \
|
||||||
-lgenpolyclip -lz
|
-lgenpolyclip -lz
|
||||||
|
|
||||||
INCLUDES = -I$(top_srcdir)/src/Lib
|
INCLUDES = -I$(top_srcdir)/src/Lib
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <simgear/debug/logstream.hxx>
|
#include <simgear/debug/logstream.hxx>
|
||||||
#include <simgear/math/sg_geodesy.hxx>
|
#include <simgear/math/sg_geodesy.hxx>
|
||||||
#include <simgear/misc/sgstream.hxx>
|
#include <simgear/misc/sgstream.hxx>
|
||||||
|
#include <simgear/timing/timestamp.hxx>
|
||||||
|
|
||||||
#include STL_IOSTREAM
|
#include STL_IOSTREAM
|
||||||
#include STL_STRING
|
#include STL_STRING
|
||||||
|
@ -463,11 +464,22 @@ main (int argc, const char **argv)
|
||||||
int type = feature.getTopologyType();
|
int type = feature.getTopologyType();
|
||||||
cerr << "Searching through " << nTopologies << " topologies" << endl;
|
cerr << "Searching through " << nTopologies << " topologies" << endl;
|
||||||
int nAttributes = attributes.size();
|
int nAttributes = attributes.size();
|
||||||
|
SGTimeStamp start, now;
|
||||||
|
start.stamp();
|
||||||
|
long start_sec = start.get_seconds();
|
||||||
|
|
||||||
TGPolygon mask;
|
TGPolygon mask;
|
||||||
for (int i = 0; i < nTopologies; i++) {
|
for (int i = 0; i < nTopologies; i++) {
|
||||||
if ((i % 10) == 0)
|
if ((i % 50) == 0) {
|
||||||
cerr << (double)i * 100.0 / (double)nTopologies << "% done ..." << endl;
|
now.stamp();
|
||||||
|
long now_sec = now.get_seconds();
|
||||||
|
double elapsed_min = (now_sec - start_sec) / 60.0;
|
||||||
|
double percent = (double)i / (double)nTopologies;
|
||||||
|
cerr << percent*100.0 << "% done ...";
|
||||||
|
cerr << " total time = " << elapsed_min / percent;
|
||||||
|
cerr << " (min) finished in " << elapsed_min / percent - elapsed_min
|
||||||
|
<< " minutes" << endl;
|
||||||
|
}
|
||||||
if (feature.isTiled()) {
|
if (feature.isTiled()) {
|
||||||
VpfRectangle rect = feature.getTile(i).getBoundingRectangle();
|
VpfRectangle rect = feature.getTile(i).getBoundingRectangle();
|
||||||
if (!bounds.isOverlapping(vpf2tg(rect)))
|
if (!bounds.isOverlapping(vpf2tg(rect)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue