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

World clock with localtimes.info not working on my angular js app

I tried to place a world clock with 5 countries in my website, which I developed using AngularJs. I used localtimes.info website which provides an embed link. It doesn't work for me, but it works with a general HTML page without angularjs. Here is…
Srinivasan
  • 293
  • 1
  • 6
  • 16
0
votes
1 answer

To implement OS for 'preemptive' tasks, what hardware feature should cpu support?

For example, to implement an operating system that's like unix or NT, which supports different tasks switching based on time slices, what kind of hardware support should cpu have? Does intel 80286 begin to support implementation of 'preemptive'…
Troskyvs
  • 7,537
  • 7
  • 47
  • 115
0
votes
2 answers

state transitions dependent upon input event VHDL

I am a newbie in VHDL. I am currently working on an FSM and I want my state machine to change states only when my input changes. What changes should I make in the following code? entity fsm is Port ( clk : in STD_LOGIC; reset : in…
Taimur Wajad
  • 101
  • 3
0
votes
4 answers

Why is this output waiting for something after it?

void Wait(double Duration) { clock_t End; End = clock() + (Duration*CLOCKS_PER_SEC); while (clock() < End) { // This loop just stalls the program. } } My function works perfectly half the time, but it occasionally…
Maxpm
  • 24,113
  • 33
  • 111
  • 170
0
votes
1 answer

std::chrono calls QueryPerformanceFrequency repeatedly?

Whenever I call: std::chrono::high_resolution_clock::now().time_since_epoch().count(); The assembly instructions for it are: std::chrono::high_resolution_clock::now().time_since_epoch().count(); 00007FF7D9E11840 call qword ptr…
Zebrafish
  • 11,682
  • 3
  • 43
  • 119
0
votes
1 answer

Linux timer CLOCK_PROCESS_CPU_ID is not working

I need to use some timers in my code. I've got something like this: struct sigevent ec; ec.sigev_notify = SIGEV_THREAD; ec.sigev_value.sival_ptr = &c_timer; ec.sigev_notify_function = c_thread; ec.sigev_notify_attributes =…
0
votes
1 answer

C extern clock_t variables not working as expected in file;

So I have, 3 files; main.c , file.c file.h in file.h I declared 3 variables extern clock_t start_t, end_t, total_t; in file.c I wrote a function to save the length of time of main running program; and in file.h I reference it as "void…
Arn as
  • 23
  • 2
0
votes
1 answer

Relative C code execution time analysis using system monotonic clock

Is there is a simple but sure way to measure the relative differences in performance between two algorithm implementations in C programs. More specifically, I want to compare the performance of implementation A vs. B? I'm thinking of a scheme like…
TSIguy
  • 65
  • 1
  • 7
0
votes
1 answer

Changing the GPU clock rate on a linux like system (Nvidia Jetson TX1)

I have a Nvidia Jetson tx1 board and want to change the gpu rate by writing in the following file: sudo echo 691200000 > /sys/kernel/debug/clock/override.gbus/rate sudo echo 1 > /sys/kernel/debug/clock/override.gbus/state However I get greeted with…
Kev1n91
  • 3,553
  • 8
  • 46
  • 96
0
votes
1 answer

Simulink Clock Synchronisation

In simulink if I run any simulation, it follows an internal clock. I want to run these simulations in real time. Example: if I use a PWM pulse generator and give it a sample time of 1 second, I expect that it will generate a sample at the end of…
sixtyTonneAngel
  • 901
  • 2
  • 8
  • 11
0
votes
3 answers

Java Clock too fast

Attempting to make a clock in java in my spare time, having lots of fun and two hours in i am still getting problems with my code. it tells me the current time but advances way too quickly. (copy and paste it into an IDE/Compiler and run it and you…
0
votes
1 answer

how can I abort a funciton after elapsed time?

I am testing some algorithms and timing them. I would like to know how to abort the function while its running if it runs for longer than 60 seconds. Here's what I'm working with: #include "stdafx.h" #include #include #include…
0
votes
1 answer

How to slave the audio clock to the system clock using ALSA?

I want to make the audio clock to be a slave to the system clock or use the system clock to drive the audio system instead of the audio clock. Is this possible with ALSA?
Jan Deinhard
  • 19,645
  • 24
  • 81
  • 137
0
votes
1 answer

Clock source Selection for CAN bus Controller

Currently I am using a 32bit micrcontroller with embedded CAN controller. I am confused to select the clock source for CAN controller (based on 2.0 version Part A & B), as I have 3 options for clock source, Cascaded FMPLL clock, External Crystal…
0
votes
1 answer

VHDL clocked LED Sequence Part 2

I have to write a program that changes an LED sequence at each clock pulse for one sequence. library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.numeric_std.all; entity REG_LED is PORT(CLK: IN std_logic; …