This repository was archived by the owner on May 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSynchronousChef.cs
More file actions
83 lines (72 loc) · 2.19 KB
/
SynchronousChef.cs
File metadata and controls
83 lines (72 loc) · 2.19 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
using System;
using System.Threading;
namespace CSharpAsyncExample
{
public class SynchronousChef
{
public int DelayMultiply { get; set; }
public SynchronousChef()
{
DelayMultiply = 100;
}
public void MakeBreakfast()
{
BoilWater();
BoilEggs();
FryBacon();
ToastBread();
ApplyButter();
ApplyJam();
PourCoffee();
PourJuice();
}
public void PourCoffee()
{
Console.WriteLine("[Chef] Start pouring coffee");
Thread.Sleep(5 * DelayMultiply);
Console.WriteLine("[Chef] Coffee Ready");
}
public void BoilEggs()
{
Console.WriteLine("[Chef] Put Eggs into boiling water");
Thread.Sleep(70 * DelayMultiply);
Console.WriteLine("[Chef] Eggs Boiled");
}
public void FryBacon()
{
Console.WriteLine("[Chef] Throw bacon in pan");
Thread.Sleep(40 * DelayMultiply);
Console.WriteLine("[Chef] Bacon Fried");
}
public void ToastBread()
{
Console.WriteLine("[Chef] Put bread in toaster");
Thread.Sleep(20 * DelayMultiply);
Console.WriteLine("[Chef] Bread Toasted");
}
public void ApplyButter()
{
Console.WriteLine("[Chef] Start spreading Butter");
Thread.Sleep(15 * DelayMultiply);
Console.WriteLine("[Chef] Butter applied");
}
public void ApplyJam()
{
Console.WriteLine("[Chef] Start spreading Jam");
Thread.Sleep(15 * DelayMultiply);
Console.WriteLine("[Chef] Jam applied");
}
public void PourJuice()
{
Console.WriteLine("[Chef] Start pouring Juice");
Thread.Sleep(5 * DelayMultiply);
Console.WriteLine("[Chef] Juice Ready");
}
public void BoilWater()
{
Console.WriteLine("[Chef] Set coffee water to boil");
Thread.Sleep(200 * DelayMultiply);
Console.WriteLine("[Chef] Coffee Water is boiled");
}
}
}