Questions tagged [system-clock]

109 questions
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
  • 23,198
  • 15
  • 61
  • 101
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
  • 16,726
  • 9
  • 66
  • 132
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
  • 1,455
  • 1
  • 16
  • 24
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
  • 10,386
  • 29
  • 103
  • 172
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…
4
votes
3 answers

Increasing the speed of qemu clock

I'm trying to increase the speed at which qemu runs, so for example one tick of the real CPU will correspond to two ticks of the virtual time of qemu. Is this possible and if so does anyone have any pointers on how to go about doing this?
mwray
  • 41
  • 1
  • 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,265
  • 1
  • 10
  • 36
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

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
  • 188
  • 1
  • 2
  • 10
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
  • 43,537
  • 19
  • 96
  • 144
3
votes
1 answer

What does it mean by "partial ordering" and "total ordering" in the discussion of Lamport's synchronization Algorithm?

What I understand is, partial ordering and total ordering are two sets of rules. Partial ordering has Three rules: (1) if a an b are two events in the same process and a comes before b, then a->b. (2) ... (3) ... What is total ordering…
user366312
  • 17,582
  • 55
  • 198
  • 392
3
votes
4 answers

How to increase sleep/pause timing accuracy in python?

I ran an experiment to compare sleep/pause timing accuracy in python and C++ Experiment summary: In a loop of 1000000 iterations, sleep 1 microsecond in each iteration. Expected duration: 1.000000 second (for 100% accurate program) In python: import…
Ahmed Hussein
  • 617
  • 1
  • 13
  • 33
3
votes
2 answers

What is the meaning of claims about clock precision/accuracy?

I've seen a lot of discussions of system clocks where it's said that e.g. standard PC clocks under e.g. Windows are precise only +/-10ms, whereas on a real time system clocks have submillisecond precision. But what do these claims mean? How…
Matt Phillips
  • 8,691
  • 8
  • 41
  • 72