/*
timestampformat alias is the only part of the script you might
need to modify, specifically the part after the word "return".
Examples:
HH:nn:ss. $+ $timems
$+([HH:nn:ss.,$timems,])
yyyy-mm-dd HH:nn:ss. $+ $timems
/help $asctime
/help $+
*/
alias timestampformat return HH:nn:ss. $+ $timems
/*
echo alias is optional. It is only needed if you want the millisecond
timestamp to update in the middle of other scripts that use echo, but:
THIS CAN POTENTIALLY BREAK OTHER SCRIPTS.
To see the difference, use the following command with and without the echo alias.
//set -l %x 100 | while (%x) { echo -t <-- | dec %x }
*/
alias echo {
if (-*t* iswmcs $1) {
set -l %t $asctime($timestampformat)
!echo $iif($removecs($1,t) != -,$v1) $iif($window($2),$2 %t $3-,%t $2-)
}
else !echo $1-
}
alias timems return $right($calc($dll(time.dll,ticks,0)-%ticksoffset),3)
on *:start:timestampfix
alias timestampfix {
set -l %c $ctime + 1
while (%c > $ctime) noop
set -e %ticksoffset $dll(time.dll,ticks,0) % 1000
.timertimestamp -om 0 0 .timestamp -f $!timestampformat
}