Loading
  1. <%@ LANGUAGE=VBScript %>
  2. <!--#INCLUDE FILE="aspJSON1.17.asp"-->
  3. <%
  4.  
  5. ' Set the page content headers
  6. Response.ContentType = "application/json"
  7. Response.Charset = "UTF-8"
  8.  
  9. ' Set the default response
  10. Set oJSONResponse = New aspJSON
  11. oJSONResponse.data("result") = "OK"
  12. oJSONResponse.data("details") = "JSON data parsed successfully"
  13. oJSONResponse.data("action") = "wtf"
  14.  
  15. ' Create the fieldPoints collection
  16. Set oJSONResponse.data("fieldPoints") = oJSONResponse.Collection()
  17.  
  18. ' Start the loop
  19. x = 1
  20. starttime = Timer()
  21. Do Until x = 2500
  22.  
  23. '    Response.Write """fieldName"", ""field name here (x="&x&")""" & VbCrLf
  24. '    Response.Write """fieldID"", ""field id here (x="&x&")""" & VbCrLf
  25. '    Response.Write """fieldArea"", ""field area here (x="&x&")""" & VbCrLf
  26. '    Response.Write """lat"", ""lat here (x="&x&")""" & VbCrLf
  27. '    Response.Write """long"", ""long here (x="&x&")""" & VbCrLf
  28. '    Response.Write VbCrLf
  29.  
  30.     Set newitem = oJSONResponse.AddToCollection(oJSONResponse.data("fieldPoints"))
  31.     newitem.add "fieldName", "field name here (x="&x&")"
  32.     newitem.add "fieldID", "field id here (x="&x&")"
  33.     newitem.add "fieldArea", "field area here (x="&x&")"
  34.     newitem.add "lat", "lat here (x="&x&")"
  35.     newitem.add "long", "long here (x="&x&")"
  36.     newitem.add "timer", endtime-starttime & " (x="&x&")"
  37.  
  38.     x = x + 1
  39. Loop
  40. endtime = Timer()
  41. Response.Write "The FIRST task completed in " & endtime-starttime & "s (" & (endtime-starttime)*1000 & " milliseconds)." & vbcrlf & vbcrlf
  42.  
  43.  
  44. ' Write the response
  45. Response.Write oJSONResponse.JSONoutput()
  46. endtime2 = Timer()
  47. Response.Write "The SECOND task completed in " & endtime2-starttime & "s (" & (endtime2-starttime)*1000 & " milliseconds)." & vbcrlf & vbcrlf
  48.  
  49.  
  50. ' Clean up
  51. Set oJSONResponse = nothing
  52.  
  53. %>

Comments