Skip to content

Instantly share code, notes, and snippets.

View timleavitt's full-sized avatar

Tim Leavitt timleavitt

View GitHub Profile
@timleavitt
timleavitt / DC.LoopPerformance.cls
Last active September 12, 2018 20:50
Caché ObjectScript demo - various loops to iterate over pieces of a delimited string
/// This class demonstrates the performance of various loops that iterate over the pieces of a delimited string.
Class DC.LoopPerformance
{
ClassMethod Run(pIterations As %Integer = 10000, pPieceLength As %Integer = 20, pNumberPieces = 100, pDelimiter = ",")
{
#define START(%msg) Write %msg Set start = $zh
#define END Write ($zh - start)," seconds",!
// Build a random string given the specifications