summaryrefslogtreecommitdiff
path: root/src/vim.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-11-24 17:22:50 +0100
committerBram Moolenaar <Bram@vim.org>2016-11-24 17:22:50 +0100
commit833eb1d752426689051bf2001083359899536939 (patch)
treef91eeead037b689d8d02bd1e47704332a63d7de0 /src/vim.h
parent2cab0e191055a8145ccd46cd52869fbb9798b971 (diff)
downloadvim-git-833eb1d752426689051bf2001083359899536939.tar.gz
patch 8.0.0097v8.0.0097
Problem: When a channel callback consumes a lot of time Vim becomes unresponsive. (skywind) Solution: Bail out of checking channel readahead after 100 msec.
Diffstat (limited to 'src/vim.h')
-rw-r--r--src/vim.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/vim.h b/src/vim.h
index eec3e4f73..c91e52bb2 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -2503,4 +2503,20 @@ typedef enum
# define OPEN_CHR_FILES
#endif
+#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
+# define ELAPSED_TIMEVAL
+# define ELAPSED_INIT(v) gettimeofday(&v, NULL)
+# define ELAPSED_FUNC(v) elapsed(&v)
+# define ELAPSED_TYPE struct timeval
+ long elapsed(struct timeval *start_tv);
+#else
+# if defined(WIN32)
+# define ELAPSED_TICKCOUNT
+# define ELAPSED_INIT(v) v = GetTickCount
+# define ELAPSED_FUNC(v) elapsed(v)
+# define ELAPSED_TYPE DWORD
+ long elapsed(DWORD start_tick);
+# endif
+#endif
+
#endif /* VIM__H */