Advertisement
rerdavies

Untitled

May 1st, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. using System;
  2. using System.Runtime.InteropServices;
  3.  
  4. /*
  5. *
  6. */
  7. namespace Mu
  8. {
  9.  
  10. // prevents PInvoke (not in NativeMethods class) or Stack walk (NativeMethods class) performance penalties.
  11. internal static partial class SafeNativeMethods
  12. {
  13. [DllImport("kernel32")]
  14. internal extern static UInt64 GetTickCount64();
  15.  
  16. }
  17. public static class MuTime
  18. {
  19. public static UInt64 UpTimeMillis { get { return SafeNativeMethods.GetTickCount64(); } }
  20. }
  21. }
  22.  
  23. /*
  24. Copyright (c) 2020 Robin Davies Dual License (use either, not both)
  25.  
  26. CC-BY-SA 3.0 (due to StackExchange terms of use). Not my fault, blame StackExchange. Fix this please!
  27. To avoid CC-BY-SA, access a copy of this code at (xxx) to use under BSD 0-clause license (see end of file)
  28. BSD 0-clause
  29.  
  30. BSD 0-Clause
  31. Copyright 2020 Robin Davies.
  32.  
  33. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
  34.  
  35. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  36. WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
  37. OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  38. OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
  39. THIS SOFTWARE.
  40. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement