comparison src/ex_cmds2.c @ 4764:f824cb97eb92 v7.3.1129

updated for version 7.3.1129 Problem: Can't see what pattern in syntax highlighting is slow. Solution: Add the ":syntime" command.
author Bram Moolenaar <bram@vim.org>
date Thu, 06 Jun 2013 14:01:46 +0200
parents c80838526eeb
children 66803af09906
comparison
equal deleted inserted replaced
4763:1b5ca3e53566 4764:f824cb97eb92
956 # endif 956 # endif
957 } 957 }
958 958
959 # endif /* FEAT_PROFILE || FEAT_RELTIME */ 959 # endif /* FEAT_PROFILE || FEAT_RELTIME */
960 960
961 #if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_FLOAT)
962 # if defined(HAVE_MATH_H)
963 # include <math.h>
964 # endif
965
966 /*
967 * Divide the time "tm" by "count" and store in "tm2".
968 */
969 void
970 profile_divide(tm, count, tm2)
971 proftime_T *tm;
972 proftime_T *tm2;
973 int count;
974 {
975 if (count == 0)
976 profile_zero(tm2);
977 else
978 {
979 # ifdef WIN3264
980 tm2->QuadPart = tm->QuadPart / count;
981 # else
982 double usec = (tm->tv_sec * 1000000.0 + tm->tv_usec) / count;
983
984 tm2->tv_sec = floor(usec / 1000000.0);
985 tm2->tv_usec = round(usec - (tm2->tv_sec * 1000000.0));
986 # endif
987 }
988 }
989 #endif
990
961 # if defined(FEAT_PROFILE) || defined(PROTO) 991 # if defined(FEAT_PROFILE) || defined(PROTO)
962 /* 992 /*
963 * Functions for profiling. 993 * Functions for profiling.
964 */ 994 */
965 static void script_do_profile __ARGS((scriptitem_T *si)); 995 static void script_do_profile __ARGS((scriptitem_T *si));
1048 /* 1078 /*
1049 * Return <0, 0 or >0 if "tm1" < "tm2", "tm1" == "tm2" or "tm1" > "tm2" 1079 * Return <0, 0 or >0 if "tm1" < "tm2", "tm1" == "tm2" or "tm1" > "tm2"
1050 */ 1080 */
1051 int 1081 int
1052 profile_cmp(tm1, tm2) 1082 profile_cmp(tm1, tm2)
1053 proftime_T *tm1, *tm2; 1083 const proftime_T *tm1, *tm2;
1054 { 1084 {
1055 # ifdef WIN3264 1085 # ifdef WIN3264
1056 return (int)(tm2->QuadPart - tm1->QuadPart); 1086 return (int)(tm2->QuadPart - tm1->QuadPart);
1057 # else 1087 # else
1058 if (tm1->tv_sec == tm2->tv_sec) 1088 if (tm1->tv_sec == tm2->tv_sec)