Changeset View
Changeset View
Standalone View
Standalone View
plugins/debuggercommon/tests/debuggees/debugeeslow.cpp
Show All 12 Lines | 1 | /* | |||
---|---|---|---|---|---|
13 | You should have received a copy of the GNU Library General Public License | 13 | You should have received a copy of the GNU Library General Public License | ||
14 | along with this library; see the file COPYING.LIB. If not, write to | 14 | along with this library; see the file COPYING.LIB. If not, write to | ||
15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
16 | Boston, MA 02110-1301, USA. | 16 | Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #include <iostream> | 19 | #include <iostream> | ||
20 | 20 | | |||
21 | #ifndef _MSC_VER | ||||
21 | #include <unistd.h> | 22 | #include <unistd.h> | ||
23 | #else | ||||
24 | #include <Windows.h> | ||||
25 | #define sleep Sleep | ||||
26 | #endif | ||||
22 | 27 | | |||
23 | void foo() { | 28 | void foo() { | ||
24 | static int i=0; | 29 | static int i=0; | ||
25 | ++i; | 30 | ++i; | ||
26 | std::cout << i << std::endl; | 31 | std::cout << i << std::endl; | ||
27 | sleep(2); | 32 | sleep(2); | ||
28 | } | 33 | } | ||
29 | 34 | | |||
30 | int main() { | 35 | int main() { | ||
31 | std::cout << "Hello, world!" << std::endl; | 36 | std::cout << "Hello, world!" << std::endl; | ||
32 | for (int i=0; i<3; i++) { | 37 | for (int i=0; i<3; i++) { | ||
33 | foo(); | 38 | foo(); | ||
34 | } | 39 | } | ||
35 | 40 | | |||
36 | return 0; | 41 | return 0; | ||
37 | } | 42 | } |