-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.cpp
More file actions
50 lines (40 loc) · 706 Bytes
/
Test.cpp
File metadata and controls
50 lines (40 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Test.cpp : Defines the entry point for the console application.
//
// This is my test code
// This repo will be used to write test codes.
#include "stdafx.h"
#include <iostream>
#include <thread>
#include <memory>
using namespace std;
void prints()
{
int i = 0;
while (i < 4)
{
cout << "printing sachith" << endl;
this_thread::sleep_for(2s);
i++;
}
}
void printm()
{
int i = 0;
while (i < 3)
{
cout << "printing mandy" << endl;
this_thread::sleep_for(2s);
i++;
}
}
int main()
{
cout << "printing main1" << endl;
std::thread t1(prints);
t1.join();
cout << "printing main2" << endl;
std::thread t2(printm);
t2.join();
cout << "printing main3" << endl;
return 0;
}