Questions tagged [system-clock]

130 questions
6
votes
1 answer

Google AppEngine server instance clock synchronization

I just came across the following paragraph in the AppEngine documentation for Query Cursors: An interesting application of cursors is to monitor entities for unseen changes. If the app sets a timestamp property with the current date and time…
Markus A.
  • 12,349
  • 8
  • 52
  • 116
6
votes
4 answers

Handling time in a text-based game (Java)

I'm trying to work up a basic text-based game as I'm learning Java. I'd like to be able to count rounds in the game as a means of managing the pacing of certain events. For instance, changing rooms could be limited to once per round (a second, in…
eenblam
  • 438
  • 1
  • 6
  • 20
6
votes
1 answer

How could SystemClock.uptimeMillis() ever wrap?

The Android docs on uptimeMillis() says: Returns milliseconds since boot, not counting time spent in deep sleep. Note: This value may get reset occasionally (before it would otherwise wrap around). It seems quite strange that the docs are worried…
yydl
  • 24,284
  • 16
  • 65
  • 104
4
votes
2 answers

Is Thread.Sleep now using high res timer or have Windows 10 changed default system clock frequency?

Thread.Sleep used to be tied to the system clock which clocked in at a interval at roughly 16 ms, so anything below 16ms would yield 16ms sleep. The behaviour seems to have changed some way down the line line. What has changed? Is Thread.Sleep no…
Anders
  • 17,306
  • 10
  • 76
  • 144
4
votes
1 answer

Reliable cross-platform way to obtain the method time in Java

This question is not about benchmark. I have a java thread cycle that should to operate close to a period time T: public class MyRunnable implements Runnable { private final long period = 10000L; //period T, in this case 10 secs public…
Duloren
  • 2,395
  • 1
  • 25
  • 36
4
votes
2 answers

HAL_RCC_OscConfig takes too long (appx 170 μS), I need it to be <50 μS when waking from STOP

Development for STM32L053R8 on NUCLEO-L053R8 board. We have a system which "wakes" from sleep every 200 μS or so, does a small amount of work then goes back to sleep (Stop mode). Ideally I'd like to wake from STOP in under 50 μS. The…
PsyUk
  • 43
  • 5
4
votes
2 answers

Weird org.threeten.bp.DateTimeException thrown?

My code was working just fine. Today suddenly I started getting this exception - org.threeten.bp.DateTimeException: Field DayOfMonth cannot be printed as the value 1872095944 max width is 2 This is my simple code : LocalDateTime date =…
Ashwin
  • 12,691
  • 31
  • 118
  • 190
4
votes
1 answer

Making a pipelined processor with instructions issued in alternate clock cycles

Why can't we design a (semi)pipelined processor that issues instruction at every alternate clock tick, instead of the pipelined processor that issues instruction at every clock tick? Having the instructions wait would probably reduce the hazards and…
Akhilesh
  • 53
  • 3
4
votes
1 answer

Accurate inter process timer on Linux

I would like to measure the ping time between a sender process and a consumer. Both processes run on the same physical host, Linux 64 bit. I'm currently using clock_gettime(CLOCK_REALTIME, &cur_ts);. I basically capture the current timestamp cur_ts…
Emanuele
  • 1,408
  • 1
  • 15
  • 39
4
votes
1 answer

Does REALTIME clock support leap seconds?

I have a call like clock_gettime(CLOCK_REALTIME), does it handle leap seconds? If not, what changes are required? Working on Solaris.
user1145280
  • 371
  • 1
  • 2
  • 10
3
votes
2 answers

What precision is used by std::chrono::system_clock?

Here's some code that I found: std::cout << std::chrono::system_clock::now().time_since_epoch().count() << std::endl; This prints 1662563612364838407 for me; so it looks like this prints the number of nanoseconds since the UNIX epoch…
oliver
  • 6,204
  • 9
  • 46
  • 50
3
votes
2 answers

How to get the true value of the system clock in raw ticks (i.e. mach_absolute_time) in a x86_64 process running under Rosetta 2?

I'm writing a macOS x86_64 application that cannot currently be compiled as a universal binary due to library dependencies that are x86_64 only. This app needs to interact with other processes that are running as arm64 on Apple Silicon macs, and in…
Bri Bri
  • 2,169
  • 3
  • 19
  • 44
3
votes
2 answers

Multiple System Time Clock

I'm looking for a way to have multiple time clocks running along side the system time clock that are also accessible programatically so that I could access their time values much like I can system time with C#. A third party framework is acceptable.…
danielea
  • 318
  • 1
  • 3
  • 11
3
votes
0 answers

std::condition_variable sensitive to the system clock

I have some code that uses condition_variable. When the system clock gets set backwards, the condition_variable will wait for much longer because it uses system_clock instead of steady_clock. I have seen some workarounds posted here for this issue.…
JVW
  • 51
  • 4
3
votes
1 answer

await Task.Delay of over 15 ms doesn't wait long enough

In troubleshooting a test that validated concurrency I discovered that some of our build machines (running in VMs) consistently report that tasks aren't waiting the full Task.Delay interval. To confirm, I wrote a test which creates a histogram of…
Kaleb Pederson
  • 45,767
  • 19
  • 102
  • 147
1
2
3
8 9