Posted to tcl by net vs http at Wed Oct 11 02:35:52 GMT 2017view raw
- ::tcl::tm::path add [pwd]
- package require net
- package require http
- proc t(net) {url} {
- set s [net call $url]
- $s wait
- $s response data
- }
- proc t(http) {url} {
- http::data [http::geturl $url]
- }
- set url http://www.google.com/
- #puts [list [t(http) $url]]
- #puts [list [t(net) $url]]
- #exit
- puts [time {t(http) $url} 10]
- puts [time {t(net) $url} 10]