Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Done Modified last command prompt duration

Jan
616
15
Add the ability to display H:MM:SS.mmm for last command runtime to the PROMPT.

i.e. 0:13:51.037 is much more user friendly compared to 831.037

With the help of the ISO8601 plugin (thanks Charles)
Code:
set prompt=%%@dectotime[%%@eval[$=/86400],256]
doesn't work.
 
Poor man's version:

1574089875157.png
 
Would this be of use?
I'll give it a try.

Why not just $T ?
I want the duration of the last run command, not the current time of day.

Poor man's version:
That's much easier than my current pre_exec and prompt where I use your 4UTILS plugin.
Code:
0:00:00.345
[C:\BIN\JPSoft\TCCLE14]
11:35:04 $ alias PRE_EXEC
set STARTTIME=%@CLOCK[0]

0:00:00.001
[C:\BIN\JPSoft\TCCLE14]
11:35:53 $ set prompt
$e[35;2m%@TCONVERT[%@eval[(%@CLOCK[0]-%[STARTTIME])/1000]]$e[0m$_$e[32;2m[$P]$_$e[35;1m$t$s$$$e[0m$s

I've got a working prompt, just thought I'd offer up the suggestion for the next version of TCC.
 
I have done this in quite a few ways ... PRE_EXEC/PROMPT and PRE_EXEC/POST_EXEC/PROMPT (with both TCC's TIMER/@TIMER and my own CLOCK/@CLOCK) ... also with Charles's _CMDTIME in the prompt and with the built-in $=. All of them seem to have a built-in bias of about .05 second. See this below where I have $= in my prompt. TIMER gives .001 while %= gives .052.

Code:
0.052 v:\> timer & timer
Timer 1 on: 11:43:42
Timer 1 off: 11:43:42  Elapsed: 0:00:00.001

0.052 v:\>

Here's the same with Charles's %_CMDTIME in my prompt.

Code:
0:00:00.062 v:\> timer & timer
Timer 1 on: 11:46:09
Timer 1 off: 11:46:09  Elapsed: 0:00:00.001

0:00:00.051 v:\>

Does anyone have an idea why that happens?
 

Similar threads

Back
Top