locked
No TimeSpan.FromSeconds() in C++

    Question

  • The TimeSpan is different in C++ and C#. How can I convert TimeSpan.FromSeconds() to C++?

    Charlie Chang L

    Thursday, August 16, 2012 1:21 PM

Answers

  • Hi Charlie,

    You can use the "Duration" property. It is expressed in 100-nanosecond units. 

    -Sagar

    • Marked as answer by Jesse Jiang Wednesday, August 22, 2012 6:43 AM
    Thursday, August 16, 2012 2:05 PM
    Moderator
  • Hi,

     

    You can set duration with these codes:

     
    	Windows::Foundation::TimeSpan ts;
    	ts.Duration=500;
    	Windows::UI::Xaml::Duration dur(ts);
    	Scenario1Storyboard->Duration=dur;

    Best regards,

    Jesse



    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Jesse Jiang Wednesday, August 22, 2012 6:43 AM
    Friday, August 17, 2012 7:29 AM

All replies

  • Hi Charlie,

    You can use the "Duration" property. It is expressed in 100-nanosecond units. 

    -Sagar

    • Marked as answer by Jesse Jiang Wednesday, August 22, 2012 6:43 AM
    Thursday, August 16, 2012 2:05 PM
    Moderator
  • Hi,

     

    You can set duration with these codes:

     
    	Windows::Foundation::TimeSpan ts;
    	ts.Duration=500;
    	Windows::UI::Xaml::Duration dur(ts);
    	Scenario1Storyboard->Duration=dur;

    Best regards,

    Jesse



    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Jesse Jiang Wednesday, August 22, 2012 6:43 AM
    Friday, August 17, 2012 7:29 AM
  • Any other solution without using Windows lib which can also apply in Linux?

    Tuesday, April 30, 2013 8:37 AM