I use this function in some of my projects:
 Code:
Function TimeStamp($_ID)
  $PERFLOG = $PERFLOG + @DATE + ' ' + @TIME + '.' + Right('000' + @MSECS, 3) + ' - ' + $_ID + @CRLF
  Exit 0
  
EndFunction
The function is called as TimeStamp('ID'), where "ID" is a line number or code block identifier. $PERFLOG is a global var that contains all the timestamp text and is written to a file just prior to the script exiting. This overhead is minimal while processing, compared to writing to the log at each invocation. The log write is as simple as
 Code:
$ = RedirectOutput('.\perflog.log', 1)
$PERFLOG
$ = RedirectOutput('')
Glenn
_________________________
Actually I am a Rocket Scientist! \:D