From ca762eaaa411698b3534c5ee280746b419dad904 Mon Sep 17 00:00:00 2001 From: Lee Leahu Date: Thu, 22 Oct 2009 00:45:31 -0500 Subject: show how long miMoveWindow ran --- mi/miwindow.c | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/mi/miwindow.c b/mi/miwindow.c index c233393..266da2d 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c @@ -274,6 +274,16 @@ miMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pNextSib, VTKind kind) WindowPtr windowToValidate; WindowPtr pLayerWin; + struct timeval total_start, total_stop; + suseconds_t total; + int time_error = 0; + + if (gettimeofday(&total_start, NULL)) { + time_error = 1; + fprintf(stderr, "miMoveWindow: Timing Error! - total_start\n"); + } + + /* if this is a root window, can't be moved */ if (!(pParent = pWin->parent)) return ; @@ -325,6 +335,26 @@ miMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pNextSib, VTKind kind) } if (pWin->realized) WindowsRestructured (); + + + + if (gettimeofday(&total_stop, NULL)) { + time_error = 1; + fprintf(stderr, "miMoveWindow: Timing Error! total_stop\n"); + } + + if (!time_error) { + total = total_stop.tv_usec - total_start.tv_usec; + fprintf(stderr, + "miMoveWindow: Total Time Spent: %li\n", + total + ); + } + + + fprintf(stderr, "\n"); + + } -- 1.6.4.4