Skip to content

Instantly share code, notes, and snippets.

@steamb23
Created January 4, 2016 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steamb23/fe595e4a51dcb06fbd1f to your computer and use it in GitHub Desktop.
Save steamb23/fe595e4a51dcb06fbd1f to your computer and use it in GitHub Desktop.
SecureInt64
Create: 0.0037 ms
Write: 0.4398 ms
Value: 623416731
Raw Value: -253872919152700637
Read: 0.001 ms
temp Value: 623416731
secureLong Value: 623416731
Write: 0.0003 ms
Value: 5896214
Raw Value: 3712924929963454150
Read: 0 ms
temp Value: 5896214
secureLong Value: 5896214
Int64 (long)
Create: 0 ms
Write: 0 ms
Value: 623416731
Read: 0 ms
temp Value: 623416731
secureLong Value: 623416731
Write: 0.0003 ms
Value: 5896214
Read: 0.0003 ms
temp Value: 5896214
secureLong Value: 5896214
long temp;
Stopwatch timer = new Stopwatch();
Console.WriteLine(" SecureInt64");
Console.WriteLine();
// 생성
timer.Restart();
SecureInt64 secureLong;
timer.Stop();
Console.WriteLine("Create: {0} ms\n", timer.Elapsed.TotalMilliseconds);
// 쓰기
timer.Restart();
secureLong = 623416731;
timer.Stop();
Console.WriteLine("Write: {0} ms\nValue: {1}\nRaw Value: {2}\n", timer.Elapsed.TotalMilliseconds, secureLong, secureLong.GetRawValue());
// 읽기
timer.Restart();
temp = secureLong;
timer.Stop();
Console.WriteLine("Read: {0} ms\ntemp Value: {1}\nsecureLong Value: {2}\n", timer.Elapsed.TotalMilliseconds, temp, secureLong);
// 쓰기
timer.Restart();
secureLong = 5896214;
timer.Stop();
Console.WriteLine("Write: {0} ms\nValue: {1}\nRaw Value: {2}\n", timer.Elapsed.TotalMilliseconds, secureLong, secureLong.GetRawValue());
// 읽기
timer.Restart();
temp = secureLong;
timer.Stop();
Console.WriteLine("Read: {0} ms\ntemp Value: {1}\nsecureLong Value: {2}\n", timer.Elapsed.TotalMilliseconds, temp, secureLong);
Console.WriteLine();
Console.WriteLine(" Int64 (long)");
Console.WriteLine();
// 생성
timer.Restart();
long nonSecureLong;
timer.Stop();
Console.WriteLine("Create: {0} ms\n", timer.Elapsed.TotalMilliseconds);
// 쓰기
timer.Restart();
nonSecureLong = 623416731;
timer.Stop();
Console.WriteLine("Write: {0} ms\nValue: {1}\n", timer.Elapsed.TotalMilliseconds, nonSecureLong);
// 읽기
timer.Restart();
temp = nonSecureLong;
timer.Stop();
Console.WriteLine("Read: {0} ms\ntemp Value: {1}\nsecureLong Value: {2}\n", timer.Elapsed.TotalMilliseconds, temp, nonSecureLong);
// 쓰기
timer.Restart();
nonSecureLong = 5896214;
timer.Stop();
Console.WriteLine("Write: {0} ms\nValue: {1}\n", timer.Elapsed.TotalMilliseconds, nonSecureLong);
// 읽기
timer.Restart();
temp = nonSecureLong;
timer.Stop();
Console.WriteLine("Read: {0} ms\ntemp Value: {1}\nsecureLong Value: {2}\n", timer.Elapsed.TotalMilliseconds, temp, nonSecureLong);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment