January 22, 2020, 12:33:40 PM

Author Topic: [BMax 1.50] Does MilliSecs() return Int or Long?  (Read 196 times)

Offline Adam Novagen

  • Jr. Member
  • **
  • Posts: 11
[BMax 1.50] Does MilliSecs() return Int or Long?
« on: December 13, 2019, 05:43:55 PM »
Title says it all. This is such a hilariously simple question I almost feel dumb for asking, but I can't for the life of me find any indication of what value MilliSecs() returns. I'm just looking to make a totally accurate playtime calculator for my engine, but obviously I need to account for the possibility of MilliSecs() looping into the negatives, which means I need to know its maximum range.

Offline _PJ_

  • Jr. Member
  • **
  • Posts: 41
Re: [BMax 1.50] Does MilliSecs() return Int or Long?
« Reply #1 on: December 13, 2019, 06:22:20 PM »
It returns an Integer
However, it can be passed to a Long in 64-bit

Offline Adam Novagen

  • Jr. Member
  • **
  • Posts: 11
Re: [BMax 1.50] Does MilliSecs() return Int or Long?
« Reply #2 on: December 14, 2019, 03:48:08 AM »
It returns an Integer
However, it can be passed to a Long in 64-bit
Okay. This means that, by default, it will loop at 2147483647, right? i.e. even if I store the value in a Long variable, the initial value returned by MilliSecs() will switch to negative once it passes 2^31?

Online Derron

  • Hero Member
  • *****
  • Posts: 2673
Re: [BMax 1.50] Does MilliSecs() return Int or Long?
« Reply #3 on: December 14, 2019, 07:56:46 AM »

Offline Adam Novagen

  • Jr. Member
  • **
  • Posts: 11
Re: [BMax 1.50] Does MilliSecs() return Int or Long?
« Reply #4 on: December 14, 2019, 11:28:34 PM »
Oooooh, that is an excellent set of Types, will definitely use that. Thanks a million, Ron! Is this your own work?

Online Derron

  • Hero Member
  • *****
  • Posts: 2673
Re: [BMax 1.50] Does MilliSecs() return Int or Long?
« Reply #5 on: December 15, 2019, 06:47:12 AM »
This very special function is copied from the source mentioned there. If there is no source mentioned it is most probably my code.


Bye
Ron