Questions tagged [clock]

Hardware and system clocks used by drivers, OS and hardware languages.

Clocks are key to controlling synchronous logic and are used by drivers, and OS software. As well, hardware languages, such as and can make extensive use of clocks. CPU or system clocks are familiar to most developers, but a typical computer can contain many different clocks to control different hardware functions such as video, audio, RAM, buses, etc. Familiar current time functions are often derived from a hardware clock which produces interrupts allowing an OS to keep a running time count by recording the interrupt; sometimes called ticks or jiffies.

Related tags

  • - obtaining, formatting times and other uses.
  • - program issues dealing with dates.
  • - measuring execution time with a clock.

See also: PLL, Clock divider

2060 questions
0
votes
0 answers

How can I update tkinter window

I made this code. I need an update every second, but I can't use .after(1000,func) like.after(1000, func) like a clock. I can't use time.sleep(1). I don't know what else to do. Please help me solve this. import tkinter from datetime import…
0
votes
0 answers

Clock.schedule_interval iteration not working in Kivy (Python)

I am using the Clock module in kivy.clock. I have 5 different images that need to be constantly checked for coordinates from LEAP Motion. The current code works perfectly, however I am unable to figure out why, when iterated, only the last scheduled…
0
votes
2 answers

How to make a digital clock within a status bar in pygame (without tkinter)?

Currently I am doing an assignment for school to create a game in Pygame. I am stuck on the process of creating a clock which determines the; days, hour, and minute. So far I have created some code but my Pygame crashes when ever I run it. I know…
Joshua
  • 35
  • 1
  • 9
0
votes
1 answer

kivy python clock schedule update

'main_loop' function while loop does not increment self.i value every 5 seconds and 'run' function does not decrement self.mycounter value every 1 second. Why? What am I doing wrong? I do not want to use time.sleep. class MyThread(BoxLayout): …
user5892612
0
votes
0 answers

Android: Are clock ticks reliable to use them in a time sensitive application?

I have been informed that Android's clock ticks are not reliable to use them in an application which heavily depends upon time being accurate to one second! If this is the case, then is there a reliable way available which can help develop the…
0
votes
3 answers

time.time() values jumping

Issue: When calling the function time.time() I notice it jumping about 30 seconds after reboot. By jumping I mean it changes its return value by about 40 seconds instantly. Setup: I am running my script on a Raspberry Pi 3B, immeadiately after…
xXliolauXx
  • 1,273
  • 1
  • 11
  • 25
0
votes
2 answers

VB.NET TimeOfDay without Date

I'm trying to show the time of day using the computer's clock, but in the previous time zone (i.e. -1 hour). I've been doing it this way: Dim Tneg1 As String = Now.AddHours(-1) lblClock.Text = UTCneg1 Where Tneg1 is a variable to…
K-leb
  • 9
  • 5
0
votes
2 answers

Why my Java alarm clock code doesn't work properly?

I want the code to trigger the JOptionPane. Here is the code for the working clock: new Thread() { public void run() { while (true) { GregorianCalendar cal = new GregorianCalendar(); int hour =…
Crystalzord
  • 135
  • 2
  • 16
0
votes
2 answers

Syncing two clocks on remote environments in a predictable way

I don't have any mathematical background, so please excuse my language. motivation Two different computers running a clock which is being reset to the same value (integer, i.e 1464009526876). There will be no communication between the two computers…
silicakes
  • 6,364
  • 3
  • 28
  • 39
0
votes
1 answer

Measure time for executing C program by using Netbeans

I have a problem about Netbeans. This is my code : #include #include #include int main(){ int i; clock_t start, finish; start = clock(); for(i = 0; i < 10000000000; i++); finish = clock(); printf("%f",…
Tinh Huynh
  • 76
  • 2
  • 6
0
votes
3 answers

JavaScript clock not showing current time on mobile devices

I got this JavaScript Code to display the current time on my website, works perfectly for desktop but it doesn't work on mobile devices It freezes on the time when the user visits the page Is it any way to make this possible? Something like refresh…
ermac
  • 428
  • 1
  • 5
  • 13
0
votes
3 answers

How to detect system clock tampering in Java

I have the need to detect if the clock of a PC is drifting or is being manipulated in a standalone Java application, in an offline situation. How can I detect this? The application will be in the hands of the users for least of 3 hours in a crowded…
Maxvader
  • 115
  • 7
0
votes
2 answers

Timer to represent AI reaction times

I'm creating a card game in pygame for my college project, and a large aspect of the game is how the game's AI reacts to the current situation. I have a function to randomly generate a number within 2 parameters, and this is how long I want the…
0
votes
3 answers

Measuring execution time with clock in sec in C not working

I'm trying to measure execution time in C using clock() under linux using the following: #include #include #include int main(int argc, char const* argv[]) { clock_t begin, end; begin = clock(); sleep(2); end =…
0
votes
1 answer

Clock.unschedule not working when referenced with bind() in kivy

I'm making a game with kivy for android that has the player controlled by touching on certain areas on the screen. I create invisible buttons (char_controls) that when tapped down, the character moves. The moment the finger is released, I would like…
Bam8000
  • 15
  • 2
  • 7
1 2 3
99
100