Skip to content

Instantly share code, notes, and snippets.

@roryl
Last active August 8, 2016 11:18
Show Gist options
  • Save roryl/947eeaf158db69f021f983925fcd1813 to your computer and use it in GitHub Desktop.
Save roryl/947eeaf158db69f021f983925fcd1813 to your computer and use it in GitHub Desktop.
Lucee Parallel Functions Example
<cfscript>
myArray = [1,2,3,4,5,6];
writeDump(myArray);
flipped = myArray.map(function(value){
return value * -1;
});
writeDump(flipped);
</cfscript>
<cfscript>
myArray = []
loop from="1" to="100" index="i"{
myArray.append(randRange(1,10));
}
timer type="inline"{
flipped = myArray.map(function(value){
// sleep(100);
return value * -1;
});
}
</cfscript>
<cfscript>
myArray = []
loop from="1" to="100" index="i"{
myArray.append(randRange(1,10));
}
timer type="inline"{
flipped = myArray.map(function(value){
// sleep(100);
return value * -1;
}, true);
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment