SFML community forums

Help => System => Topic started by: Rodd on April 29, 2018, 11:57:03 pm

Title: asMicroseconds Int64 or Uint64 ?
Post by: Rodd on April 29, 2018, 11:57:03 pm
Hello,

why the method asMicroseconds() returns Int64 and not UInt64  in Time.hpp ? :)
Title: Re: asMicroseconds Int64 or Uint64 ?
Post by: FRex on April 30, 2018, 02:38:19 am
Because sf::Time can represent a negative amount of time.

You can pass negative values to functions that return sf::Time and it has an unary - operator.

It's mentioned in the tutorial too so it's not a mistake or oversight: https://www.sfml-dev.org/tutorials/2.4/system-time.php