update test_sgraph

This commit is contained in:
David Rose 2001-08-07 16:01:08 +00:00
parent 5785c5888e
commit 4343bb8c98
2 changed files with 33 additions and 3 deletions

View File

@ -36,6 +36,8 @@
#define TARGET test_sgraph
#define LOCAL_LIBS \
sgraph mathutil graph putil
#define OTHER_LIBS \
pystub
#define SOURCES \
test_sgraph.cxx

View File

@ -16,12 +16,40 @@
//
////////////////////////////////////////////////////////////////////
#include "camera.h"
#include "geomNode.h"
#include <notify.h>
#include "pointerTo.h"
#include "clockObject.h"
#include "notify.h"
int main() {
nout << "running test_sgraph" << endl;
PT(Camera) cam = new Camera("camera");
ClockObject *c = ClockObject::get_global_clock();
int i;
int count = 100000;
double start, finish;
PT(Node) node;
node = new GeomNode("foo");
start = c->get_real_time();
for (i = 0; i < count; i++) {
node->is_of_type(GeomNode::get_class_type());
}
finish = c->get_real_time();
cerr << "test 1: " << (finish - start) / (double)count * 1000.0
<< " ms\n";
node = new NamedNode("foo");
start = c->get_real_time();
for (i = 0; i < count; i++) {
node->is_of_type(GeomNode::get_class_type());
}
finish = c->get_real_time();
cerr << "test 2: " << (finish - start) / (double)count * 1000.0
<< " ms\n";
return 0;
}