September 28, 2021, 16:57:50

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

• Jr. Member
• Posts: 18
##### [BMax 1.50] Does MilliSecs() return Int or Long?
« on: December 13, 2019, 17:43:55 »
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.
« Last Edit: December 13, 2019, 17:46:01 by Adam Novagen »

#### _PJ_

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

• Jr. Member
• Posts: 18
##### Re: [BMax 1.50] Does MilliSecs() return Int or Long?
« Reply #2 on: December 14, 2019, 03:48:08 »
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?

#### Derron

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

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

#### Derron

• Hero Member
• Posts: 3653
##### Re: [BMax 1.50] Does MilliSecs() return Int or Long?
« Reply #5 on: December 15, 2019, 06:47:12 »
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