-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathClassCreationTimer.cs
More file actions
43 lines (36 loc) · 842 Bytes
/
Copy pathClassCreationTimer.cs
File metadata and controls
43 lines (36 loc) · 842 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
using UnityEngine;
using System;
using System.Collections;
using System.Diagnostics;
public class ClassCreationTimer : MonoBehaviour
{
public int classesToCreate;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
if (Input.GetKeyDown(KeyCode.E))
{
createClasses();
}
}
void createClasses()
{
Stopwatch _stopWatch = new Stopwatch();
UnityEngine.Debug.Log("creating classes");
_stopWatch.Start();
for (int i = 0; i < classesToCreate; i++)
{
TestClass temp = new TestClass();
}
_stopWatch.Stop();
TimeSpan ts = _stopWatch.Elapsed;
UnityEngine.Debug.Log(ts.TotalMilliseconds);
}
}
public class TestClass
{
}