Glenn, instead of using a string manipulation with right(...)in the function, why don't you use directly @TICKS, which is the number of milliseconds elapsed since computer was last booted ?
with a code like that :
 Code:
Function TimeStamp($_ID)
  $PERFLOG = $PERFLOG + @DATE + ' ' + @TIME + '.' + @TICKS + ' - ' + $_ID + @CRLF
  Exit 0
EndFunction
you can calculate the elapsed time between two lines just by a subtraction on the field n°4

An other way for quickt result in the code :
 Code:
$start=@TICKS
...
. your code here
...
@$start=@TICKS-$start
"elapsed time : " $start " ms" ?
At the end of the block, $start contains the elapsed time in milliseconds.
_________________________
Christophe