Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/11/2008, 15:28
Avatar de Myakire
Myakire
Colaborador
 
Fecha de Ingreso: enero-2002
Ubicación: Centro de la república
Mensajes: 8.849
Antigüedad: 23 años, 3 meses
Puntos: 146
Respuesta: Consulta sobre escritura de cod ASP, básica quizás :(

Haz un archivo ASP, copia estos códigos y coméntanos tus conclusiones:

Código asp:
Ver original
  1. 'MODO 1
  2. tiempoinicio = Timer
  3. For i = 1 To 800000
  4. %>*<%
  5. Next
  6. tiempototal = FormatNumber(Timer - tiempoinicio, 3, True)
  7. Response.Write "<br>MODO 1: " & tiempototal & "<br>"
  8.  
  9. 'MODO 2
  10. tiempoinicio = Timer
  11. For i = 1 To 800000
  12. Response.Write "*"
  13. Next
  14. tiempototal = FormatNumber(Timer - tiempoinicio, 3, True)
  15. Response.Write "<br>MODO 2: " & tiempototal & "<br>"
  16.  
  17. 'MODO 3
  18. tiempoinicio = Timer
  19. With Response
  20. For i = 1 To 800000
  21. .Write "*"
  22. Next
  23. End With
  24. tiempototal = FormatNumber(Timer - tiempoinicio, 3, True)
  25. Response.Write "<br>MODO 3: " & tiempototal & "<br>"

Luego, corre estos otros dos códigos que comparan la impresión directa VS la concatenación:

Código asp:
Ver original
  1. 'MODO 4
  2. tiempoinicio = Timer
  3. Cadena = ""
  4. response.write "<ul>"
  5. for i = 1 to 10000  
  6. response.write "<li>" & i & "</li>"
  7. next
  8. response.write "</ul>"
  9. Response.Write Cadena & "<br>"
  10. tiempototal = FormatNumber(Timer - tiempoinicio, 3, True)
  11. Response.Write "<br>MODO 4: " & tiempototal & "<br>"
  12.  
  13. 'MODO 5
  14. tiempoinicio = Timer
  15. cadena = "<ul>"
  16. for i = 1 to 10000
  17. cadena= cadena& "<li>" & i & "</li>"
  18. next
  19. cadena= cadena& "</ul>"
  20. response.write cadena & "<br>"
  21. tiempototal = FormatNumber(Timer - tiempoinicio, 3, True)
  22. Response.Write "<br>MODO 5: " & tiempototal & "<br>"