summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-03-09 22:37:52 +0000
committerBram Moolenaar <Bram@vim.org>2006-03-09 22:37:52 +0000
commit1056d988442648527a45366c9d16523cdc521031 (patch)
treeafd2b3182b3c81edf3f95a34c10b3a3ea2e5c833 /src/ex_cmds2.c
parent4ea8fe1d0600a7020c9f3a652f1d429a96965311 (diff)
updated for version 7.0219v7.0219
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r--src/ex_cmds2.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 00dcea9ebf..ad49d45340 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -911,6 +911,28 @@ profile_add(tm, tm2)
}
/*
+ * Add the "self" time from the total time and the children's time.
+ */
+ void
+profile_self(self, total, children)
+ proftime_T *self, *total, *children;
+{
+ /* Check that the result won't be negative. Can happen with recursive
+ * calls. */
+#ifdef WIN3264
+ if (total->QuadPart <= children->QuadPart)
+ return;
+#else
+ if (total->tv_sec < children->tv_sec
+ || (total->tv_sec == children->tv_sec
+ && total->tv_usec <= children->tv_usec))
+ return;
+#endif
+ profile_add(self, total);
+ profile_sub(self, children);
+}
+
+/*
* Get the current waittime.
*/
void
@@ -3000,8 +3022,8 @@ do_source(fname, check_other, is_vimrc)
profile_end(&si->sn_pr_start);
profile_sub_wait(&wait_start, &si->sn_pr_start);
profile_add(&si->sn_pr_total, &si->sn_pr_start);
- profile_add(&si->sn_pr_self, &si->sn_pr_start);
- profile_sub(&si->sn_pr_self, &si->sn_pr_children);
+ profile_self(&si->sn_pr_self, &si->sn_pr_start,
+ &si->sn_pr_children);
}
}
#endif
@@ -3505,9 +3527,9 @@ script_line_end()
++pp->snp_count;
profile_end(&si->sn_prl_start);
profile_sub_wait(&si->sn_prl_wait, &si->sn_prl_start);
- profile_add(&pp->sn_prl_self, &si->sn_prl_start);
profile_add(&pp->sn_prl_total, &si->sn_prl_start);
- profile_sub(&pp->sn_prl_self, &si->sn_prl_children);
+ profile_self(&pp->sn_prl_self, &si->sn_prl_start,
+ &si->sn_prl_children);
}
si->sn_prl_idx = -1;
}