728x90
using System.Diagnostics;
using System.Numerics;
using CodeStage.AntiCheat.ObscuredTypes;
using UnityEngine;
using Debug = UnityEngine.Debug;
public class Test_Obscured : MonoBehaviour
{
private BigInteger m_Value1 = 100000;
private BigInteger m_Value2 = 1000;
private ObscuredString m_ObsValue1 = "100000";
private ObscuredString m_ObsValue2 = "1000";
private string m_StrValue1 = "100000";
private string m_StrValue2 = "1000";
private void Start()
{
var watch = new Stopwatch();
watch.Start();
BigInteger tmp1;
for (var i=0; i<10000; i++)
tmp1 = m_Value1 + m_Value2;
watch.Stop();
Debug.Log($"Value Time {watch.ElapsedMilliseconds}/1000 sec");
watch.Restart();
BigInteger tmp2;
for (var i=0; i<10000; i++)
tmp2 = BigInteger.Parse(m_ObsValue1) + BigInteger.Parse(m_ObsValue2);
watch.Stop();
Debug.Log($"ObsValue Time {watch.ElapsedMilliseconds}/1000 sec");
watch.Restart();
BigInteger tmp3;
for (var i=0; i<10000; i++)
tmp3 = BigInteger.Parse(m_StrValue1) + BigInteger.Parse(m_StrValue2);
watch.Stop();
Debug.Log($"StrValue Time {watch.ElapsedMilliseconds}/1000 sec");
}
}
728x90
'프로그래밍 > C#' 카테고리의 다른 글
C# Generic return T (0) | 2022.10.02 |
---|---|
버프 시스템 클래스 (0) | 2022.05.27 |
제트브레인 라이더(Rider) 코파일럿(Copilot) 사용법 (0) | 2022.02.21 |
C# 가상함수(Virtual)와 오버라이드(override) (0) | 2022.01.14 |
C# Action<> 의 활용 (0) | 2021.10.15 |
댓글