Questions tagged [time-precision]

35 questions
4
votes
2 answers

Actionscript 3 high precision time method (microseconds)?

I need a high precision time method in microseconds rather than milliseconds for actionscript, unfortunately I couldn't find much help on the web. I need such control in order to implement the usage of a fixed timestep in transitions as described in…
Tom
  • 8,536
  • 31
  • 133
  • 232
4
votes
3 answers

How accurate can I expect the time to be from a stratum 0 NTP server on the same subnet on ethernet?

I have an application that depends on gpsd and ntpd to accurately set the system time on a linux machine. gpsd is fed NMEA + PPS The application is punping ~25MB per second over the network and I think the loading on the system is causing jitter in…
JeffV
  • 52,985
  • 32
  • 103
  • 124
4
votes
2 answers

Java timing, System.nanoTime() batter than System.currentTimeMillis() but does it persist over sleep?

I am trying to implement a timer, it may be used for short (seconds) events, or longer (hours, etc) events. Ideally it should persist over periods when the CPU is off, for example, battery has died. If I set the start time using…
Tony Tieger
  • 113
  • 2
  • 4
3
votes
2 answers

Data type for nanosecond time precision in Java

I would like to have a numeric variable that contains integer number with nanosecond precision. I tried this: Instant t = Instant.now(); a = BigDecimal.valueof(t.getEpochSecond() * 1e9 + t.getNano()); b = BigDecimal.valueof(t.getEpochSecond() * 1e9…
Michal Špondr
  • 1,337
  • 2
  • 21
  • 44
3
votes
2 answers

Use sub-second precision on "earliest" in Splunk query

I have a Splunk search string. If I add earliest=10/05/2020:23:59:58, the search string still works. However, if I changed that to earliest=10/05/2020:23:59:58:01, I got an error message say invalid value "10/05/2020:23:59:58:01" for time term…
Jie
  • 1,107
  • 1
  • 14
  • 18
3
votes
1 answer

PostgreSQL: CURRENT_TIMESTAMP AND CLOCK_TIMESTAMP Resolution: Windows vs. Linux?

So I have this interesting problem with the PostgreSQL timing functions. Here's the situation. We have a pre-production server (Linux) that we house our in-development applications. I also do some work on a local copy of that DB (Windows) in case…
Bat Masterson
  • 1,164
  • 3
  • 11
  • 27
3
votes
4 answers

Set linux time to millisecond precision

I have an embedded Linux device that interfaces with another "master" device over a serial comm protocol. Periodically the master passes its date down to the slave device, because later the slave will return information to the master that needs to…
mdavis
  • 191
  • 3
  • 7
2
votes
2 answers

Set time_t to milliseconds

I have a function and I want the function to stop running once it has been running for a certain number of milliseconds. This function works for seconds but I want to test it for milliseconds. How do I do this? If I set eliminate = 1, it corresponds…
Ruven Guna
  • 414
  • 7
  • 25
2
votes
2 answers

Exact delay in screen draw and keyboard keypress event in Qt

I am working on a Qt project in which exact time at which certain events occur is of prime importance. To be specific: I have a very simple animation that must be drawn to the screen at certain time say t1. Once I issue the QWidget update to start…
amiya
  • 21
  • 4
2
votes
4 answers

Concurrency-Issue using ExecuteNonQuery

I'm writing simple text log Entries to an SQL-table like so: private SqlConnection sqlcon; // ... try { sqlcon.Open(); SqlCommand cmd = sqlcon.CreateCommand(); cmd.CommandText = this.logString; cmd.ExecuteNonQuery(); } /* catch…
klamann
  • 1,697
  • 17
  • 28
1
vote
8 answers

How can I (reasonably) precisely perform an action every N milliseconds?

I have a machine which uses an NTP client to sync up to internet time so it's system clock should be fairly accurate. I've got an application which I'm developing which logs data in real time, processes it and then passes it on. What I'd like to do…
Jon Cage
  • 36,366
  • 38
  • 137
  • 215
1
vote
0 answers

Accessing subsecond timestamp values of struct stat in a portable way

The stat(2) manual addresses the support for nanosecond resolution for the timestamp fields, but it doesn't look trivial to test their presence or their names in a program intended to be portable: as many as four feature test macro names…
musiphil
  • 3,837
  • 2
  • 20
  • 26
1
vote
2 answers

What's the most precise timer in .NET?

I want to use a timer that allows me to run a specific code at certain intervals but Winforms timer is very inaccurate. I set it to 2 seconds but it goes off as much as 48 seconds. The kind of code I am running is highly dependent on acting as soon…
Joan Venge
  • 315,713
  • 212
  • 479
  • 689
0
votes
1 answer

Is there a place that I could look at the .NET Stopwatch code and see what it's doing?

Is there a place that I could look at the .NET Stopwatch code and see what it's doing? I'm trying to match up some C++ code to normalize timestamp that .NET stopwatch provides with QueryPerformance call in C++. (I need to have really good…
lucidquiet
  • 6,124
  • 7
  • 51
  • 88
0
votes
0 answers

How to improve time precision of two independent time series?

Imagine we have two merged timeseries (by asof), one of them has very precise clocks (micro/nanoseconds) second has millisecond precision, assuming that timedrift is relatively low and clocks are synced (~10 microseconds precision), how to…
PavelP
  • 25
  • 1
  • 5