/* Windows Windows Windows */ #include #include #include #include #include #include using namespace std; class timer { private: typedef std::chrono::high_resolution_clock hi_res_clock; typedef std::chrono::duration > second_; std::chrono::time_point start_time ; public: timer() : start_time(hi_res_clock::now()) {} void reset() { start_time = hi_res_clock::now(); } double elapsed() const { double t ; t = std::chrono::duration_cast ( hi_res_clock::now() - start_time ).count() ; return(t) ; } }; void print_time(const string & heading , const double & t) { cout << heading << " : " ; cout.setf(ios::right); cout.setf(ios::showpoint); cout.setf(ios::fixed); cout.width(10); cout.precision(6); cout << t << endl; } int main() { //Heading and timing variables string heading; double t; timer timer_01; timer timer_02; int i; heading = "Program starts"; t=timer_01.elapsed(); print_time( heading , t); timer_01.reset(); // Internet variables const int n_sites=37; /* check the base address https://www.metoffice.gov.uk/pub/data/weather/uk/climate/stationdata/cwmystwythdata.txt */ string base_address = "https://www.metoffice.gov.uk/pub/data/weather/uk/climate/stationdata/"; string station_name[]= { "aberporth", "armagh", "ballypatrick", "bradford", "braemar", "camborne", "cambridge", "cardiff", "chivenor", "cwmystwyth", "dunstaffnage", "durham", "eastbourne", "eskdalemuir", "heathrow", "hurn", "lerwick", "leuchars", "lowestoft", "manston", "nairn", "newtonrigg", "oxford", "paisley", "ringway", "rossonwye", "shawbury", "sheffield", "southampton", "stornoway", "suttonbonington", "tiree", "valley", "waddington", "whitby", "wickairport", "yeovilton", }; string web_address[n_sites]; string last_part="data.txt"; string input_string; // create the web address of each file for (i=0;i