Search Unity

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,073
    It looks like there is no realtimeSinceStartup in the Tiny API.
     
  3. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    241
    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