Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Tiny C# Preview: How to get current RealTime?

Discussion in 'Project Tiny' started by oceanxiao, Jul 7, 2019.

  1. oceanxiao

    oceanxiao

    Joined:
    Jan 19, 2016
    Posts:
    10
    I wanna test the performence of AsmJS. Here is my code:
    upload_2019-7-7_17-10-50.png
    Result in chrome DevTools:
    upload_2019-7-7_17-12-44.png
    Unfortunately it cannot work. Is there some method like "Time.realtimeSinceStartup" or "DateTime.Now"?
    Any help is appreciated!
     

    Attached Files:

  2. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    7,389
    It looks like there is no realtimeSinceStartup in the Tiny API.
     
  3. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    381
    If you publish it to webgl. For the time being I have hack it like this

    upload_2019-7-29_19-3-57.png

    upload_2019-7-29_19-5-22.png

    You could look at BrowserInterop sample how to call interop function

    But sadly I wish unity could just include DateTimeOffset and some more class in namespace System into project tiny
     
unityunity