clock

Clock drift on Windows

I've developed a Windows service which tracks business events. It uses the Windows clock to timestamp events. However, the underlying clock can drift quite dramatically (e.g. losing a few seconds per minute), particularly when the CPUs are working hard. Our servers use the Windows Time Service to stay in sync with domain controllers, whi...

How can I resolve the drifting clock for my Virtual Machine?

My Virtual Machine's clock drifts pretty significantly. There's documentation out there about dealing with this, but nothing seems to be working very well. Anyone have any suggestions, things that worked well for them, ... Supposedly updating regularly via ntp is not a good solution. ...

How Do You Programmatically Set the Hardware Clock on Linux?

Linux provides the stime(2) call to set the system time. However, while this will update the system's time, it does not set the BIOS hardware clock to match the new system time. Linux systems typically sync the hardware clock with the system time at shutdown and at periodic intervals. However, if the machine gets power-cycled before o...

Quick question: Java system clock

What's a simple/easy way to access the system clock using Java, so that I can calculate the elapsed time of an event? ...

Writing a more efficient clock function.

I have a clock feature in a VB.NET program that displays the time including the seconds. I currently have a timer constantly polling using NOW. I have to poll the system clock quite often because I need to have the second update in sync with the system clock. Is there a more direct to access the time only when the seconds change? Is th...

What is the effect of changing system time on sleeping threads?

If you take a look at the clock_gettime() function, which is available in all BSDs and is actually defined as part of the POSIX standard, you see that there is support for at least three types of clocks (many systems support more than these clocks, but actually the POSIX standard only demands one to be present, all others are optional): ...

Faking time without changing Windows system clock

Does anybody know of a Windows tool to report fake dates/times to a process? Apparently there are Linux programs that can be used to test how the software will react in the future / in a different timezone or to trigger scheduled tasks without actually modifying the system clock. Are there such programs for Windows? ...

How to supply a value to the javascript method Date.setTime() from PHP?

Is it time()? Is it time().substr(microtime(), 2, 2)? Is it time().substr(microtime(), 2, 3)? Kind of lost with the following snippet. function updateClock ( ) { var timeStamp = <?php echo time().substr(microtime(), 2, 2);?>; var currentTime = new Date ( ); currentTime.setTime( timeStamp ); ... ... } My goal is t...

What happened to clockless computer chips?

Several years ago, the 'next big thing' was clockless computers. The idea behind it was that without a clock, the processors would run significantly faster. That was then, this is now and I can't find any info on how it's been coming along or if the idea was a bust... Anyone know? For reference... http://www1.cs.columbia.edu/async/m...

C++ obtaining milliseconds time on Linux -- clock() doesn't seem to work properly

On Windows, clock() returns the time in milliseconds, but on this Linux box I'm working on, it rounds it to the nearest 1000 so the precision is only to the "second" level and not to the milliseconds level. I found a solution with Qt using the QTime class, instantiating an object and calling start() on it then calling elapsed() to get t...

iphone screensaver (with clock)

Could I create an iPhone app that replaces/modifies the default clock screen saver and show something else instead (e.g. my own special clock or whatever)? How do I go about doing that? I'd appreciate a link to a tutorial on the subject, or to example code that does something like this. (disclaimer: total iPhone dev noob here) ...

32 bit Linux clock() overflow

I need to measure, in C++ on Linux (and other Unix-like systems), the CPU (not wall clock) time taken by a long computation, so I'm using clock(). Problem: on 32 bit systems, this wraps around after about 2000 or 4000 seconds. What's the recommended workaround for this? ...

What are the approaches for writing a simple clock application?

I am writing a small program to display current time on iPhone (learning :D). I came across this confusion. Is calling currentSystemTime ( eg: stringFromDate: ) on every second, parse it and print the time on screen is good? Would it be more effective to call the above routine once and manually update the parsed second every tick of yo...

Replacing time() and localtime() with user-independent equivalents

I have a program that uses time() and localtime() to set an internal clock, but this needs to be changed so that the internal clock is independent of the user and the "real" time. I need to be able to set any reasonable starting time, and have it count forward depending on a timer internal to the program. Any ideas on the best way to a...

What is the best way to exit out of a loop after an elapsed time of 30ms in C++

What is the best way to exit out of a loop as close to 30ms as possible in C++. Polling boost:microsec_clock ? Polling QTime ? Something else? Something like: A = now; for (blah; blah; blah) { Blah(); if (now - A > 30000) break; } It should work on Linux, OS X, and Windows. The calculations in the loop are for up...

Digital clocking systems/software? (employee clocking)

How does a digital clocking system deal with user error such as someone forgetting to clock out or someone erroneously entering their code causing them to clock someone else in/out (who might not even be on the schedule that day). Its obvious there could be issues of dishonesty, but what about human error? ...

How to sync the clocks of multiple Fedora systems

I have a subscription system that allows users to subscribe to things or people they are interested in, and receive notifications when new posts or files or images are submitted. To determine whether something is new, I track their views by tstamp. The problem is that if the webserver and the MySQL database are out of sync, a user could...

how does the function time() tell the current time and even when the computer has been powered off earlier?

how we can work on timer deals with milliseconds (0.001) how we could divide second as we want ?? how we could we deal with the second itself ??? ...

About RTC(system clock) issue in Win7

I encountered a very very very strange issue, if My SW is still running in Idle mode on Win7, the RTC(system clock) delay 25 sec during 3 days, I addressed it's WM_TIMER issue. If I remove the timer, the issue will disappear, but I really want to know how to avoid it and why. Thanks. ...

time.h - problem with clock()

I try to measure the clock cyles needed to execute a piece of code on the TMS32064x+ DSP that comes with the OMAP ZOOM 3430 MDK. I look at the "Programmer's Guide" of the DSP chip and it says that the DSP supports the clock() function. What I do is really simple, I just do start = clock(); for (i=0;i<100;i++){ /* do something here ...