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

1897 questions
0
votes
1 answer

My Simple Game's Timer is Very Off... C++

So this is the same game from an earlier post (Link is Here). The title of that post was "C++ Clock Not Working" and I have fixed the clock, "Hooray!". Now the process I am using to calculate the duration seems to be broken. I always get 'x.y'e-05…
Noguiguy
  • 46
  • 2
  • 6
0
votes
1 answer

How to rotate image when time changes?

I have recently made a countdown timer for a website like this! It's pretty much a combination of 2 scripts I found online. The countdown counts down to February 1st and is pretty static. But the 'clockpicture' is supposed to rotate 6 degrees every…
C.B
  • 13
  • 4
0
votes
1 answer

using clock() (or similar) function to find time of execution when there are multiple processes

I want to use a function, like clock(), to find the execution time of a particular piece of code. But if there are multiple threads/processes, then would those getting scheduled in between affect the output of the clock() function? Example…
glugglug
  • 141
  • 1
  • 8
0
votes
2 answers

EOFException in a Java client-server app

I'm developing a simple client-server clock, which transmits the current time to all clients, hosted by the clock server application. There is a timed event (TimerTask) that sends the data periodically to all clients. And at the Server part it works…
user4359659
  • 149
  • 2
  • 4
  • 16
0
votes
1 answer

how to get a Python timing object to retain appropriate information within function and decorator scopes

I'm writing a module for quick and easy timing in a Python program. The idea is that little instances of clocks can be created throughout the code. These clocks are available as objects that can be started, stopped, started again and queried. Any…
d3pd
  • 6,679
  • 18
  • 56
  • 111
0
votes
1 answer

using method tickSeconds in Class Clock on Java

I am making a Swing application for a clock. I was trying to find the current time, and ended up using System.currentTimeMillis(), but I am still curious as to how to fix this. I get a lot of errors similar to this, so I would like to know how to…
MakotoE
  • 1,119
  • 1
  • 11
  • 24
0
votes
1 answer

For loops and rom in vhdl

I'm doing a musicbox with VHDL. I first played just A4 and I was successful. library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; library UNISIM; use UNISIM.VComponents.all; entity Basic is Port( clk : in STD_LOGIC; …
Strider
  • 1
  • 1
0
votes
1 answer

How should an accumulator in a Python clock be handled correctly?

I'm writing a small clock object in Python that can be started, stopped and reset. I'm having difficulty knowing how to keep track of the accumulation of time correctly. Right now, the way the update procedure is written, the clock accumulates too…
d3pd
  • 6,679
  • 18
  • 56
  • 111
0
votes
0 answers

C++ calculate exact CPU time for process in multithread experimental settings

I'm running tests for a C++ algorithm on a Ubuntu 6-core machine. I would like, for each test, measure the exact CPU time required for ONLY that test process, and not fron other tests or computer processes running on the same machine. For this…
user1403546
  • 1,379
  • 1
  • 16
  • 32
0
votes
2 answers

most efficient way to implement clock with alarm clock in Python

I am trying to implement a digital clock with alarm clock in Python. Now I am wondering what is the best way to implement the alarm clock functionality. I was able to find several similar projects, mostly concentrating on the alarm clock…
karlitos
  • 1,386
  • 3
  • 21
  • 52
0
votes
2 answers

Controlling different clocks with switches in VHDL

How can I control 2 different clocks? I wrote that clk1Hz<=newclock or newclock2; so I was going to be able to control it by choosing one of them is '1'. However, it gives me unexpected identifier error in that sentence(clk1Hz<=newclock or…
user4363945
0
votes
1 answer

How should a clock object be made in Python?

I'm making a very simple clock object in Python. I want to be able to instantiate a clock giving it a name and have it record the time it is running for, with pause functionality. I think I've nearly got it, but the pause functionality is giving me…
d3pd
  • 6,679
  • 18
  • 56
  • 111
0
votes
1 answer

Why would select localtimestamp return different timezones on 2 different machines with Postgres

If I execute on Postgres 9.2 show timezone on my machine, it returns the local time zone America/Denver when I run the same postgres command on the guy beside me, it returns US/Eastern Anyone know why the Postgres Server would use two different…
Jamie McIlroy
  • 339
  • 2
  • 7
  • 18
0
votes
1 answer

Won't update the value

I'm making a very basic automatic "Cookie Clicker" program and I got a problem with this row of code: z = Math.ceil(15*java.lang.Math.pow(1.15, x)); when x gets updated in the if-statement this row of code doesn't seem to understand that and z keep…
ShadowNinja
  • 85
  • 1
  • 5
0
votes
0 answers

Where to find drawable-resources belonging to the android AnalogClock?

I want to implement a customized AnalogClock and therefore I copied the default implementaion from android.widget.AnalogClock as a base. The implementation itself refers to some drawables (dial, minute_hand, hour_hand) which are all prefixed by…
Young Andy
  • 21
  • 2
1 2 3
99
100