Mercurial > vim
diff src/vim.h @ 10406:42911b233245 v8.0.0097
commit https://github.com/vim/vim/commit/833eb1d752426689051bf2001083359899536939
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 24 17:22:50 2016 +0100
patch 8.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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 24 Nov 2016 17:30:04 +0100 |
parents | 66f1b5bf3fa6 |
children | 401dbd352fd6 |
line wrap: on
line diff
--- 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 */