+
+void DebugScript::ClearPerformance(View * view, Screen * scr)
+{
+ m_perf_start.clock = clock();
+ m_perf_start.object_count = view->Doc().ObjectCount();
+ m_perf_start.view_bounds = view->GetBounds();
+ m_perf_last = m_perf_start;
+}
+
+void DebugScript::PrintPerformance(View * view, Screen * scr)
+{
+ DebugScript::PerformanceData now;
+ now.clock = clock();
+ now.object_count = view->Doc().ObjectCount();
+ now.view_bounds = view->GetBounds();
+ // object_count delta clock delta x deltax y deltay w deltaw h deltah
+ printf("%d\t%d\t%lu\t%lu\t%e\t%e\t%e\t%e\t%e\t%e\t%e\t%e\n",
+ now.object_count, now.object_count - m_perf_last.object_count,
+ (uint64_t)now.clock, (uint64_t)(now.clock - m_perf_last.clock),
+ Double(now.view_bounds.x), Double(now.view_bounds.x - m_perf_last.view_bounds.x),
+ Double(now.view_bounds.y), Double(now.view_bounds.y - m_perf_last.view_bounds.y),
+ Double(now.view_bounds.w), Double(now.view_bounds.w - m_perf_last.view_bounds.w),
+ Double(now.view_bounds.h), Double(now.view_bounds.h - m_perf_last.view_bounds.h));
+ m_perf_last = now;
+}