-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEventProducer.cs
More file actions
35 lines (32 loc) · 804 Bytes
/
Copy pathEventProducer.cs
File metadata and controls
35 lines (32 loc) · 804 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
using System;
using System.Collections.Generic;
using System.Diagnostics.Tracing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace realtime_session_with_stacks
{
[EventSource(Name = "EventProducer")]
internal class EventProducer : EventSource
{
internal static EventProducer Log = new EventProducer();
[Event(1)]
public void TestEvent()
{
WriteEvent(1);
}
internal static void LogEvents()
{
Task.Factory.StartNew(() =>
{
while(true)
{
Log.TestEvent();
Thread.Sleep(1000);
}
},
TaskCreationOptions.LongRunning);
}
}
}