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
1 answer

VHDL clocked LED Sequence

this is my first post on this site, im studying VHDL for my Electronics degree and have to write a program that changes an LED sequence at each clock pulse for one sequence. i think i have cracked it but this is my first time using the VHDL language…
0
votes
3 answers

How Do I Change A Body Background Image Every Hour?

For my web design class we were instructed to do a one week exercise where we figure out how to take a creative approach to a clock that tells the time and temperature. This class is graded on creativity, I am allowed and encouraged to use…
Alison Dyer
  • 69
  • 1
  • 10
0
votes
2 answers

How Do I Change My Javascript Digital Clock from Military Time to Standard Time?

I created a digital clock on my site with Javascript and would like to change it from military time to standard time. I just want it to show the hours and minutes as well. What should I do to implement this? body { background-color: black; …
Alison Dyer
  • 69
  • 1
  • 10
0
votes
2 answers

Right way to execute all if-bodies on the first method call

I use JavaScript to display a binary clock on a website. When the site is first loaded, the clock needs to be set to the right time and then updated. What is the right way to get this behaviour? Right now I have a var that is checked on every update…
w_n
  • 345
  • 3
  • 7
0
votes
2 answers

Alarm Clock in C#

I had an idea to build an alarm clock in c# with the following features Show a to-do list for the day Play a song from a list of songs chosen Completed features I've already done Show list of to-do's Play a song Show form between a certain…
Maximus
  • 29
  • 2
  • 7
0
votes
1 answer

No notifications Display, Cannot play the song and error for start button for Android Alarm Clock

I'm beginner for Android Studio I try to make the Android Alarm Clock and now it cannot display the notifications, no music has played and also there is the error for the stop button. This is my code, wish someone can help me to solve it. Thank…
Jane
  • 71
  • 3
  • 7
0
votes
2 answers

Android Alarm Clock NullException

I'm beginner for Android Studio. Currently, I'm trying to make the alarm clock by using the Android Studio. I have some error when trying to run the code. When it starts to run, it gives me these lines of error. E/AndroidRuntime: FATAL EXCEPTION:…
Jayson
  • 5
  • 4
0
votes
3 answers

polling the number of clock cyclesw in C

I am trying to continuously poll the number of clock cycles ticked and print my statement only when the cycle count is 100 + the start time . Such that if my start = 1000000, the print statement should be executed only when end = 1000100 and it…
0
votes
1 answer

Creating a simple Clock in QT

I want to create a simple clock in my Qt program: QLabel which is updated once a second. QLabel name: label_clock My clock "script": while (true) { QString time1 = QTime::currentTime().toString(); ui->label_clock->setText(time1); } But when I…
allin0n3
  • 157
  • 1
  • 4
  • 13
0
votes
1 answer

VHDL: 1 cycle delay at pop in an stack machine and not reflecting the push value

I have a VHDL stack machine which by having a push it has to reflect it at the following clock cycle, but it no reflects the value pushed, the outputs are the following: Outputs and the code is: library ieee; use ieee.std_logic_1164.all; use…
Narry
  • 3
  • 4
0
votes
0 answers

Chrono library gives 0 as elapsed time - wrong code?

Good evening fellow coders, I'm a newbie in C++ and after searching for an answer I have not come to find a helpful answer. I'm testing #pragma pack right now and want to compare access speeds with unaligned memory, therefore I have a few structs I…
Grougal
  • 17
  • 5
0
votes
1 answer

I need help to understand CLOCKS_PER_SEC

I use AMD FX 4300 with 3.8GHz, that means 3.8G clocks per sec. But when I run the command CLOCKS_PER_SEC it shows something else. #include #include int main() { printf("%lu\n",CLOCKS_PER_SEC); return…
user2353193
0
votes
0 answers

Alarm TimePicker Issue ANDROID STUDIO

I recently started java coding and I can't figure out what's wrong with TimePicker. If the Current-time is ahead of Set-time then the alarm goes off right away. If the Set-Time is ahead of Current-Time then the Alarm works fine. AlarmManager…
DroidGalaxy
  • 109
  • 11
0
votes
1 answer

Clock_t returns big negative numbers

I am trying to measure the running time in nanoseconds of a function by using clock() function, like this: clock_t start_t = clock(); random_function(); clock_t end_t = clock(); printf("Elapsed time: %f\n", (double)(end_t - start_t) /…
AN00
  • 325
  • 4
  • 13
0
votes
1 answer

Measure Clock Drift On Linux Server, PTP/NTP Clock Reference

Guys, I got a task to measure the clock drift between a linux server and an "accurate" NTP/PTP server. Any suggestion on this? Thanks
Xavier
  • 1
  • 1
1 2 3
99
100