13
0

overall timing for undo/redo ops

git-svn-id: svn://localhost/ardour2/branches/3.0@6699 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-02-18 16:34:09 +00:00
parent 993af4468b
commit 95b8a69a58

View File

@ -122,15 +122,25 @@ UndoTransaction::operator() ()
void
UndoTransaction::undo ()
{
struct timeval start, end, diff;
gettimeofday (&start, 0);
for (list<Command*>::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()