Message.cs 704 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Diagnostics;
  3. namespace UnityEditor.TestTools.TestRunner.UnityTestProtocol
  4. {
  5. [Serializable]
  6. internal abstract class Message
  7. {
  8. public string type;
  9. // Milliseconds since unix epoch
  10. public ulong time;
  11. public int version;
  12. public string phase;
  13. public int processId;
  14. protected Message()
  15. {
  16. version = 2;
  17. phase = "Immediate";
  18. processId = Process.GetCurrentProcess().Id;
  19. AddTimeStamp();
  20. }
  21. public void AddTimeStamp()
  22. {
  23. time = Convert.ToUInt64((DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds);
  24. }
  25. }
  26. }