Skip to content

Instantly share code, notes, and snippets.

@timleavitt
timleavitt / DC.LoopPerformance.cls
Last active Sep 12, 2018
Caché ObjectScript demo - various loops to iterate over pieces of a delimited string
View DC.LoopPerformance.cls
/// 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