qemacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemacs-commit] qemacs qe.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs qe.c
Date: Wed, 14 May 2014 17:19:45 +0000

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        14/05/14 17:19:45

Modified files:
        .              : qe.c 

Log message:
        added timing facility
        
        * display elapsed time for commands and display lasting more than 100 ms

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.c?cvsroot=qemacs&r1=1.169&r2=1.170

Patches:
Index: qe.c
===================================================================
RCS file: /sources/qemacs/qemacs/qe.c,v
retrieving revision 1.169
retrieving revision 1.170
diff -u -b -r1.169 -r1.170
--- qe.c        14 May 2014 17:14:05 -0000      1.169
+++ qe.c        14 May 2014 17:19:44 -0000      1.170
@@ -3945,6 +3945,7 @@
     char history[32];
     unsigned char arg_type;
     int ret, rep_count, get_arg, type, use_argval, use_key;
+    int start_time, elapsed_time;
 
     for (;;) {
         ret = parse_arg(&es->ptype, &arg_type,
@@ -4036,6 +4037,8 @@
 
     qs->this_cmd_func = d->action.func;
 
+    start_time = get_clock_ms();
+
     do {
         /* special case for hex mode */
         if (d->action.ESii != do_char) {
@@ -4057,6 +4060,10 @@
         /* CG: Should follow qs->active_window ? */
     } while (--rep_count > 0);
 
+    elapsed_time = get_clock_ms() - start_time;
+    if (elapsed_time >= 100)
+        put_status(s, "%s: %dms", d->name, elapsed_time);
+
     qs->last_cmd_func = qs->this_cmd_func;
  fail:
     free_cmd(&es);
@@ -4162,6 +4169,9 @@
 {
     EditState *s;
     int has_popups;
+    int start_time, elapsed_time;
+
+    start_time = get_clock_ms();
 
     /* first call hooks for mode specific fixups */
     for (s = qs->first_window; s != NULL; s = s->next_window) {
@@ -4196,6 +4206,10 @@
         }
     }
 
+    elapsed_time = get_clock_ms() - start_time;
+    if (elapsed_time >= 100)
+        put_status(s, "edit_display: %dms", elapsed_time);
+
     qs->complete_refresh = 0;
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]