Skip to Main Content
Mastering Delphi Programming: A Complete Reference Guide
book

Mastering Delphi Programming: A Complete Reference Guide

by Primož Gabrijelčič
November 2019
Beginner to intermediate content levelBeginner to intermediate
674 pages
15h
English
Packt Publishing
Content preview from Mastering Delphi Programming: A Complete Reference Guide

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 GUI Programming with FireMonkey

Delphi GUI Programming with FireMonkey

Andrea Magni
Delphi Cookbook - Third Edition

Delphi Cookbook - Third Edition

Daniele Spinetti, Daniele Teti

Publisher Resources

ISBN: 9781838989118Other