Questions tagged [nanotime]

Anything related to programming languages functions (or other similar facilities) allowing the retrieval of the current time with a resolution in the nanoseconds range.

Anything related to programming languages functions (or other similar facilities) allowing the retrieval of the current time with a resolution in the nanoseconds (ns) range.

146 questions
1
vote
1 answer

How to replay data from two tables with different time column types in DolphinDB?

I want to play back data from two tables. If the time columns of the two tables are of different types, for example, TIME and NANOTIME respectively, does it affect the result? Any potential pitfalls or best practices I should be aware of? Thanks in…
serendipity
  • 104
  • 5
1
vote
1 answer

fread reads large integers as integer64, which are not upcasted to doubles in case of arithemetic expressions

When a file is read through fread, the columns may be read as integer64 (correctly so), but when these are multiplied with numeric, they are not upcasted to numeric (as in C++ or integers in R). While this is a documented behavior in bit64 package.…
cryptickey
  • 169
  • 8
1
vote
2 answers

How to convert a string to a DatetimeWithNanoseconds format with python?

I have multiples strings representing timestamps. A few examples may be : 19551231 (%Y%m%d) or 20210216154500 (%Y%m%d%H%M%S). As you can see, the format may vary. I'm looking for a way to convert all these different strings to a unique…
cuzureau
  • 330
  • 2
  • 17
1
vote
1 answer

Using Instant/ChronoUnit to get the time in nanos-since-epoch at midnight today is 24 hours ahead of using GregorianCalendar/Date

I'm attempting to get today's date in nanos since Epoch at midnight (e.g. 13 Feb 2021 00:00:00). Using GregorianCalendar/Date appears to get the right result. The way I'm using Instant/ChronoUnit is giving me tomorrow at midnight (e.g 14 Feb 2021…
marathon
  • 7,881
  • 17
  • 74
  • 137
1
vote
0 answers

Converting Nanotime Object in R

I need help with the following: I am trying to convert a nanotime object in R such as: x <- nanotime("2000-01-01T15:00:00.000000001+00:00") into nanoseconds passed since January 1, 1970. Is there an easy way to accomplish this?
AndyArt
  • 11
  • 1
1
vote
2 answers

Can setTimeout's delay argument be effected at all by sub-millisecond inputs?

I understand that setTimeout doesn't necessarily fire at the exact delay you specify, because there could be other items in queue at the instant that the timeout occurs and the engine will do those things first (further delaying the time…
Lonnie Best
  • 9,936
  • 10
  • 57
  • 97
1
vote
1 answer

In DolphinDB, how do i Import data for special time types?

I have data as follows: Identifier, Domain, DateTime, GMT Offset, Type, Bid, Ask, ExchTime, BidYld, AskYld, Date CN180210=,MarketPrice, 2019-01-01T00:07:30.456396320Z,0,Quote,103.124,103.732,,3.643,3.568,2019/1/2 ... How should I handle…
dovish618
  • 156
  • 5
1
vote
1 answer

NiFi Avro Kafka message nano-timestamp (19 digits) cast to timestamp with milliseconds

I'm now facing an issue converting Kafka's message record of type long for nano-seconds (19 digits) to a string timestamp with milliseconds. The messages are coming in Avro format and contain different schemas (so we can`t statically define one…
Alexey Chibisov
  • 188
  • 1
  • 10
1
vote
1 answer

Cassandra timeuuid column to nanoseconds precision

Cassandra table has timeuuid data type column so how do I see the value of type timeuuid in nanoseconds? timeuuid: 49cbda60-961b-11e8-9854-134d5b3f9cf8 49cbda60-961b-11e8-9854-134d5b3f9cf9 How to convert this timeuuid to nanoseconds need a select…
1
vote
1 answer

Float difference in string and int format. Why?

I need the current time with nanosec. As string "%.9f" % float_time it is 1502872986.653693676. You can see 76 at the end. If I try to write the same time as int int(float_time*10**9), it will be 1502872986653693696 and 96 at the end. Why? And which…
Elena
  • 119
  • 2
  • 8
1
vote
0 answers

Android - System.nanoTime() strange behavior?

I have searched this site for an answer for what I'm seeing in my Android Marshmallow application. My application measures the duration between activitydetection api intents received. In the routine that process the intents, I use System.nanoTime()…
MrMagoo
  • 67
  • 1
  • 12
1
vote
1 answer

Why would the same code be shorter inside a for loop?

So I've written a rather silly program just to work with nanoTime a bit. I wanted to be able to check execution times of small bits of code so I figure nanoTime would be the best. I wanted to determine the average execution time of this short bit of…
Randi
  • 91
  • 1
  • 13
1
vote
1 answer

Does System.nanotime leap back or forward

I found multiple (conflicting) sources on the internet about whether System.Nanotime does or does not "leap back\forward" I found sources to indicate that clock resets do not affect System.nanotime. But do server restarts change system.nanotime?…
coder_bro
  • 10,503
  • 13
  • 56
  • 88
1
vote
2 answers

Thread.sleep(millisecond) precision

Thread.sleep(500) will suspends current thread for at least 500 milliseconds i know it may be little more than 500 but it never less than that. Now 1 millisecond=1000000 nanoseconds I want to suspend current thread for 500 milliseconds…
Faisal Bahadur
  • 498
  • 3
  • 19
1
vote
1 answer

Calculating time passed in libgdx with getDeltaTime()

i am trying to calculate the time passed in my libGDX application like this float timeSpent= 0; public void render(){ timeSpent = timeSpent + Gdx.graphics.getDeltaTime(); } by the above code i feel like the time is almost passing double the…
kr15hna
  • 529
  • 1
  • 5
  • 12