Skip to Main Content
Delphi High Performance
book

Delphi High Performance

by Primož Gabrijelčič
February 2018
Intermediate to advanced content levelIntermediate to advanced
336 pages
7h 52m
English
Packt Publishing
Content preview from Delphi High Performance

Profiling with TStopwatch

Delphi includes a helpful unit called System.Diagnostics, which implements a TStopwatch record. It allows us to measure time events with a better precision than 1 millisecond and has a pretty exhaustive public interface, as shown in the code fragment below:

type  TStopwatch = record  public    class function Create: TStopwatch; static;    class function GetTimeStamp: Int64; static;    procedure Reset;    procedure Start;    class function StartNew: TStopwatch; static;    procedure Stop;    property Elapsed: TTimeSpan read GetElapsed;    property ElapsedMilliseconds: Int64 read GetElapsedMilliseconds;    property ElapsedTicks: Int64 read GetElapsedTicks;    class property Frequency: Int64 read FFrequency; class property IsHighResolution: Boolean ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Delphi Cookbook

Delphi Cookbook

Daniele Teti

Publisher Resources

ISBN: 9781788625456Supplemental Content