1 /* cclive 2 * Copyright (C) 2010-2013 Toni Gundogdu <legatvs@gmail.com> 3 * 4 * This program is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 3 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #include <ccinternal> 19 20 #include <iostream> 21 22 #ifdef HAVE_UNISTD_H 23 #include <unistd.h> 24 #endif 25 26 #ifdef _WIN32 27 #include <windows.h> 28 #define sleep(n) Sleep(n*1000) 29 #endif 30 31 #include <ccquvi> 32 #include <ccutil> 33 #include <cclog> 34 35 namespace cc 36 { 37 wait(const int retry_wait)38void wait(const int retry_wait) 39 { 40 for (int i=1; i<=retry_wait; ++i) 41 { 42 if (i % 5 == 0) 43 cc::log << i; 44 else 45 cc::log << "."; 46 47 cc::log << std::flush; 48 sleep(1); 49 } 50 cc::log << std::endl; 51 } 52 53 } // namespace cc 54 55 // vim: set ts=2 sw=2 tw=72 expandtab: 56