Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trycf/583341890e0fc11aa032368f9e14af55 to your computer and use it in GitHub Desktop.
Save trycf/583341890e0fc11aa032368f9e14af55 to your computer and use it in GitHub Desktop.
TryCF Gist
<cfscript>
for( i = 1; i<=10; i++){
start = getTickCount();
starWarsPeeps = get("https://swapi.co/api/people/");
starWarsPlanets = get("https://swapi.co/api/planets/");
starWarsStarships = get("https://swapi.co/api/starships/");
dump( (getTickCount()-start)/1000 & " seconds");
}
function get(uri){
dump( "calling #uri# at #dateTimeFormat(now())#" );
cfhttp(url=uri, method="GET", result="response");
return deserializeJSON( response.fileContent );
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment