3 #include "canvas/debug.h"
7 uint64_t PBD::DEBUG::CanvasItems = PBD::new_debug_bit ("canvasitems");
8 uint64_t PBD::DEBUG::CanvasItemsDirtied = PBD::new_debug_bit ("canvasitemsdirtied");
9 uint64_t PBD::DEBUG::CanvasEvents = PBD::new_debug_bit ("canvasevents");
11 struct timeval ArdourCanvas::epoch;
12 map<string, struct timeval> ArdourCanvas::last_time;
13 int ArdourCanvas::render_count;
16 ArdourCanvas::set_epoch ()
18 gettimeofday (&epoch, 0);
22 ArdourCanvas::checkpoint (string group, string message)
25 gettimeofday (&now, 0);
27 now.tv_sec -= epoch.tv_sec;
28 now.tv_usec -= epoch.tv_usec;
29 if (now.tv_usec < 0) {
34 map<string, struct timeval>::iterator last = last_time.find (group);
36 if (last != last_time.end ()) {
37 time_t seconds = now.tv_sec - last->second.tv_sec;
38 suseconds_t useconds = now.tv_usec - last->second.tv_usec;
43 cout << (now.tv_sec + ((double) now.tv_usec / 1e6)) << " [" << (seconds + ((double) useconds / 1e6)) << "]: " << message << "\n";
45 cout << message << "\n";
48 last_time[group] = now;