Questions tagged [system-clock]
130 questions
1
vote
2 answers
C: Why CLOCKS_PER_SEC is printing 1000 when my processor speed is 3.10GHz
My PC configuration is
Intel Core i3-2100 CPU @3.10GHz
Windows7 64 bit
But when I'm executing below code why it's printing 1000?
#include
#include
#include
main()
{
printf("Clock %d",CLOCKS_PER_SEC);
getch();
}
The…

Anurag Chakraborty
- 421
- 2
- 5
- 20
1
vote
2 answers
Similar functionality to CLOCK_MONOTONIC in Windows (and Windows Embedded CE)
I have some C++ Windows code which needs to compute time intervals. For that, it uses GetCurrentFT if it detects that is running in WinCE and GetSystemTimeAsFileTime for other Windows platforms. However, if I'm not mistaken, this might be vulnerable…

user2891462
- 3,033
- 2
- 32
- 60
1
vote
2 answers
How to code Java Thread.sleep() in Windows with coarse timer resolution
I have an application that uses Thread.sleep(msUntilActionNeeded);. The variable is set to the number of ms until I want the program to begin an operation which coincides with the time of day, so it is not critical. Even being off by 5000ms would…

Dale
- 5,520
- 4
- 43
- 79
1
vote
2 answers
How to change the system clock rate or OS clock rate?
I want to know is there any way to change Windows or Linux clock rate or the system clock rate (maybe via BIOS)? I mean accelerate or decelerate system clock!
For example every 24 hours in the computer lasts 12 hours or 36 hours in real!!!
NOTE…

TheGoodUser
- 1,188
- 4
- 26
- 52
1
vote
0 answers
How can I make the c++ chrono steady_clock stop returning system_clock times?
I was writing a class that dealt with optional time constraints for certain methods, and so it takes classes from the std::chrono namespace to specify how to define the times. I was trying to test this method that is supposed to expire once it…

user3582926
- 59
- 6
1
vote
2 answers
SystemClock.uptimeMillis() not working
When I press the sleep button on the device then turn it back and "update" the uptime shows the time as if the device did not go to sleep.

boroloro
- 133
- 2
- 10
1
vote
2 answers
My quiz app does not give proper result and goes to final result
I am creating a quiz app ,which does the matching of telugu to english ,my aim is to have the ten questions which will display the each question for 6 seconds and move on next question.But my app waits for entire 60 seconds ,and displays just A-> to…

user2711918
- 11
- 1
1
vote
1 answer
Understand the time information of dumpsys gfxinfo
I want to understand the time information on the dumpsys gfxinfo log. It looks like this:
Applications Graphics Acceleration Info:
Uptime: 16264702 Realtime: 28169900
Can anyone tell me how to associate these figures with…

Wei Yang
- 895
- 3
- 15
- 26
1
vote
1 answer
std::chrono, adding duration to time_point
I am trying to add some duration to a time_point in Qt (C++11/MinGW) and I am having trouble:
Initialization (when the program starts):
auto program_start_time = std::chrono::system_clock::now();
auto offline_time =…

eliasp
- 9
- 1
- 3
1
vote
2 answers
virtual clock speed throttling on linux
Throttling at will the execution and display speed of a particular process, for example, a game, a flash game, or an OpenGL game. I want to be able to slow it down to 20% or 0.5%. This is simply not possible on host space in linux.
But linux…

lurscher
- 25,930
- 29
- 122
- 185
1
vote
2 answers
Any ways to park a Thread based on a free-running,system-clock-independent clock?
To make the current thread to park for a specified timeout,i can use:
LockSupport.parkNanos(long nanos);
or
Thread.sleep(long millis);//internally same as Object.wait(long) i guess.
Unfortunatly,the internal ticking of this two method are all base…

BlackJoker
- 3,099
- 2
- 20
- 27
1
vote
2 answers
Is adding another clock to the status bar on iPhone possible?
Is it possible to make either a jailbreak app/tweak or regular app that could display two times on the status bar on iPhone? Is such a thing possible and / or that's already developed?
I have a very special friend in another country and sometimes I…

thefern
- 367
- 7
- 19
1
vote
1 answer
Digital clock with date
I want to show date and time. I have used digital clock for time. its perfectly fine. But how to show date with the clock? so if date is changed in real then in my page date is also updated? I have used digital clock for time.

Dhrupal
- 1,863
- 1
- 23
- 38
1
vote
2 answers
How to Get system clock in microseconds in C++?
I am working on a project using Visual C++ /CLR in console mode.
How can I get the system clock in microseconds ?
I want to display hours:minutes:seconds:microseconds
The following program works well but is not compatible with other…

jellad.tarek
- 135
- 1
- 3
- 10
0
votes
3 answers
Instant.now(new NanoClock()) returns incorrect time
we are having a piece of code where we are using NanoClock to get the exact time. In a nut shell below is the code snippet of how i am generating the nano time and how we are converting to simple date format. the problem is, nono time (in some…

Nayan Sonthalia
- 237
- 1
- 4
- 22