added built-in timer around Scene::render() call
git-svn-id: svn://anubis/fart/trunk@195 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
parent
db72b5ba82
commit
09e97510d8
1
.todo
1
.todo
@ -1,4 +1,3 @@
|
||||
FART To-Do List
|
||||
===============
|
||||
- Test subtractions of subtractions
|
||||
- Add built-in timing around Scene::render()
|
||||
|
13
main/fart.cc
13
main/fart.cc
@ -4,6 +4,7 @@
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/time.h> /* gettimeofday() */
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include "Scene.h"
|
||||
@ -77,5 +78,17 @@ int main(int argc, char * argv[])
|
||||
|
||||
Scene scene(scene_options, argv[optind]);
|
||||
|
||||
struct timeval before, after;
|
||||
gettimeofday(&before, NULL); /* start timing */
|
||||
|
||||
scene.render();
|
||||
|
||||
gettimeofday(&after, NULL); /* stop timing */
|
||||
|
||||
double time_before = before.tv_sec + before.tv_usec / 1000000.0;
|
||||
double time_after = after.tv_sec + after.tv_usec / 1000000.0;
|
||||
double diff = time_after - time_before;
|
||||
cout << "Elapsed time: " << diff << " seconds." << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user