Created
September 4, 2019 22:08
-
-
Save trycf/4379a975d9a68f86cd104caaee81982c to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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) cachedWithin="request" { | |
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