StopWatchFlush function

[StopWatchFlush is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]

Writes out performance statistics if performance logging is enabled.


DWORD StopWatchFlush(



This function has no parameters.

Return Value


ERROR_SUCCESS on success, or an error code on failure. Possible error codes include the following:

Return code Description
No performance logs were collected.
Performance logging is not enabled.


The performance log is written to the shperf.log file in the Windows directory. If message performance logs are enabled, the message performance log is written to the msgtrace.log file in the Windows directory. If you call StopWatchFlush, you must have permission to create and modify files in the Windows directory.

Calling StopWatchFlush clears the performance logs after writing them to the shperf.log file.

See the StopWatchMode function for a description of the information that is recorded in the performance log.


Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shlwapi.h
DLL Shlwapi.dll (version 5.0 or later)