Due (Problem Set): Tuesday, September 20, 2016, 11:59 pm
Due (Programming Assignment): Tuesday, September 27, 2016, 11:59 pm
Write a simple program that takes a URL of a webpage as an input (entering it as a command line parameter is fine), reads the page content, measure the time it took to load, and prints the first few lines of the returned page together with the time it took.
The following snapshot shows the testing results of the program on gloin. It prints out the first few lines of the webpage of gmail and the time it took to load the page.
In this assignment, it is not necessary to handle errors (e.g. wrong URL). Your program does not have to print real/user/system time, only real time is required.
[yingli@gloin ~]$ ./p1 http://www.gmail.com <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> real 0.40 user 0.02 sys 0.01 [yingli@gloin ~]$
Make the solution as simple as possible. You can use any programming
language, platform, or development environment. You are expected to use
the libraries of any programming language in this assignment (e.g.
python urllib). I used a shell script in the above example
with just one line of code.
© 2016 Ying Li. Page last modified: .