- May
- 13,399
- 190
As far as I can tell, the minimum time that can be measured with $= in the prompt is 50 ms. For example
In fact anything measured with $= is 50 ms longer than when measured with TIMER.
I don't know when this started but it is not the case in v20.
Can the behavior be changed so that timing with $= will be more accurate?
Speculation: It's almost as if there's a hard-coded Sleep(50) after the start time of a command is recorded (I see the same thing if I use PRE_EXEC and POST_EXEC to do the timing myself). If that's the case, couldn't 50 ms be subtracted from $='s time (and the result max'd with 0)? If that's not the case, I'm very curious about what's happening.
Code:
v:\> eset prompt
prompt=$= $e[32;1m$p$g$s$e[0m
5.043 v:\> ()
0.050 v:\> noop
0.050
In fact anything measured with $= is 50 ms longer than when measured with TIMER.
I don't know when this started but it is not the case in v20.
Code:
g:\tc20> ver
TCC 20.11.46 Windows 7 [Version 6.1.7601]
g:\tc20> eset prompt
PROMPT=$= $e[32;1m$p$g$s$e[0m
0:00:04.98 g:\tc20> ()
0:00:00.00 g:\tc20> noop
0:00:00.00 g:\tc20>
Can the behavior be changed so that timing with $= will be more accurate?
Speculation: It's almost as if there's a hard-coded Sleep(50) after the start time of a command is recorded (I see the same thing if I use PRE_EXEC and POST_EXEC to do the timing myself). If that's the case, couldn't 50 ms be subtracted from $='s time (and the result max'd with 0)? If that's not the case, I'm very curious about what's happening.