floyd icon indicating copy to clipboard operation
floyd copied to clipboard

get_time_of_day() always returns zero

Open lemonad opened this issue 6 years ago • 3 comments

print(get_time_of_day())

always prints out zero on my machine (2017 Macbook Pro 13" with High Sierra installed).

lemonad avatar Feb 26 '19 10:02 lemonad

Hmm. Name and implementation don't match. It returns the number of milliseconds since start of application. It's one of the first host functions ever implemented, maybe rethink this API completely. Ideas?

marcusz avatar Feb 26 '19 20:02 marcusz

Then the return value of zero makes sense : ) Would all of this be real-time time or do you have virtual time too?

I know that there are a ton of pitfalls around computer time, time (and time zones!) but know far too little about the details to even know where to start. Especially lower level stuff since processes can be suspended and wake up to completely other times, clocks can be sped up/slowed down to adjust to leap seconds and daylight saving times.

Personally, at this point, I just need a seed for pseudorandom numbers so some variant of get_current_time in unix time (seconds or milliseconds) would go a long way for me.

lemonad avatar Feb 26 '19 23:02 lemonad

Will deprecated this function, introduce better replacements.

marcusz avatar Mar 05 '19 18:03 marcusz