From 95b8a69a586463b30e36ab41f9f41ba138360e16 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 18 Feb 2010 16:34:09 +0000 Subject: [PATCH] overall timing for undo/redo ops git-svn-id: svn://localhost/ardour2/branches/3.0@6699 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/pbd/undo.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/pbd/undo.cc b/libs/pbd/undo.cc index 8d65101913..223c533ff8 100644 --- a/libs/pbd/undo.cc +++ b/libs/pbd/undo.cc @@ -122,15 +122,25 @@ UndoTransaction::operator() () void UndoTransaction::undo () { + struct timeval start, end, diff; + gettimeofday (&start, 0); for (list::reverse_iterator i = actions.rbegin(); i != actions.rend(); ++i) { (*i)->undo(); } + gettimeofday (&end, 0); + timersub (&end, &start, &diff); + cerr << "Undo took " << diff.tv_sec << '.' << diff.tv_usec << endl; } void UndoTransaction::redo () { + struct timeval start, end, diff; + gettimeofday (&start, 0); (*this)(); + gettimeofday (&end, 0); + timersub (&end, &start, &diff); + cerr << "Undo took " << diff.tv_sec << '.' << diff.tv_usec << endl; } XMLNode &UndoTransaction::get_state()