# HG changeset patch # User marci # Date 1076609468 0 # Node ID 1d8d806ac8e056aa08637a4c1f019c698712671f # Parent 851ca9a60e90d77de633bafe07caf1b9441a8f54 read_dimacs_demo: measures elapsed time diff -r 851ca9a60e90 -r 1d8d806ac8e0 src/work/marci/read_dimacs_demo.cc --- a/src/work/marci/read_dimacs_demo.cc Tue Feb 10 13:29:15 2004 +0000 +++ b/src/work/marci/read_dimacs_demo.cc Thu Feb 12 18:11:08 2004 +0000 @@ -1,11 +1,20 @@ +#include #include #include + #include #include #include using namespace marci; +double currTime() { + timeval tv; + //timezone tz; + gettimeofday(&tv, 0); + return double(tv.tv_sec)+double(tv.tv_usec)/1000000.0; +} + // Use a DIMACS max flow file as stdin. // read_dimacs_demo < dimacs_flow_file int main(int, char **) { @@ -19,14 +28,17 @@ std::cout << "augmenting path flow algorithm demo..." << std::endl; ListGraph::EdgeMap flow(G); //0 flow + + double preTime=currTime(); MaxFlow, ListGraph::EdgeMap > max_flow_test(G, s, t, flow, cap); max_flow_test.run(); - + double pushTime=currTime(); std::cout << "maximum flow: "<< std::endl; for(EachEdgeIt e=G.first(); e.valid(); ++e) { std::cout<<"("<"<