nsITimelineService

IID:93276790-3daf-11d5-b67d-000064657374
Inherits From:nsISupports

nsITimelineService is used to constuct a timeline of program execution. The timeline is output to a file, either stderr or the value of the environment variable NS_TIMELINE_LOG_FILE. On the Mac, the timeline is output to the file named "timeline.txt". The reason it's different on the Mac is that the Mac environment initialization code happens after timeline initialization code.

If NS_TIMELINE_INIT_TIME is set in the environment, that will be used as the time of startup; otherwise the current time when mark() is first called will be used.

Mark() is used to put marks on the timeline.

Indent() and outdent() are used to format the timeline a bit to show nesting. This doesn't produce perfect results in the face of asychrony and multiple threads.

Enter() and leave() are convenience functions that add marks to the timeline and do indentation.

StartTimer() and stopTimer() control named stop watches. If startTimer() is called more than once, an equal number of stopTimer() calls are needed to actually stop the timer. This makes these timers slightly useful in a threaded environment.

MarkTimer() puts a mark on the timeline containing the total for the named timer.

Don't use nsITimelineService in C++ code; use the NS_TIMELINE macros instead. nsITimelineService exists so that JavaScript code can mark the timeline.

This interface is intended to be used as a service.


Methods

void enter ( char* text ) void indent ( ) void leave ( char* text ) void mark ( char* text ) void markTimer ( char* timerName ) void markTimerWithComment ( char* timerName , char* comment ) void outdent ( ) void resetTimer ( char* timerName ) void startTimer ( char* timerName ) void stopTimer ( char* timerName )

void enter ( char* text )

Enter/leave bracket code with "..." and "..." as well as indentation.

Arguments:
text

void indent ( )

Causes subsequent marks to be indented for a more readable report.


void leave ( char* text )

Arguments:
text

void mark ( char* text )

Mark() Print ": \n" in the timeline log file.

Arguments:
text

void markTimer ( char* timerName )

Arguments:
timerName

void markTimerWithComment ( char* timerName , char* comment )

Arguments:
timerName
comment

void outdent ( )

Causes subsequent marks to be outdented.


void resetTimer ( char* timerName )

Arguments:
timerName

void startTimer ( char* timerName )

Arguments:
timerName

void stopTimer ( char* timerName )

Arguments:
timerName

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com