A component that can be accurate to 1 millisecond to write custom debugging information (mainly time) into the record file
Source: Internet
Author: User
The last time I published a component used to write custom debugging information (mainly time) in the record file, it can only be accurate to about 10 milliseconds due to CLR restrictions. Later I referred to an article on the Internet: http://blog.joycode.com/lostinet/archive/2005/04/24/49590.aspx (here I would like to express my gratitude to the original author) obtained a time record that could be accurate to about 1 millisecond by calling the system API. Therefore, we re-use C # to rewrite this component and share it with everyone.
// ================================================ ====================================
// TraceSpy-used to write custom debugging information in the record File (Developer: Lin Jian)
// ================================================ ====================================
//
// Attributes:
// TraceFileName-record file name
//
// Method:
//★Text Writing
// WriteText-write custom text
// ClearAllText-clear all text
//★Time record
// SetTimePoint-set the time start point
// GetTimeSpanFromInit-query time span (from the time start point)
// GetTimeSpanFromPrev-query time span (from the last query time)
//★Custom counters
// SetCounter-set the custom counter
// AddCounter-accumulate Custom counters
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.