clock

What’s the correct way to use printf to print a clock_t?

I'm currently using a explicit cast to unsigned long long and using %llu to print it, but since size_t has the %z specifier, why clock_t doesn't have one? There isn't even a macro for it. Maybe I can assume that on a x64 system (OS and CPU) size_t has 8 byte in length (and even in this case, they have provided %z), but what about clock_t...

Any body know Clock animation using flex/flash/actionscript3?

In my application i want to show 5 clcok . In the clock shows international time depend on country based But Normal clock time i will get sytem time (getmintues and gethours ) and show . How can show all country time ?. i tried below code for animation . Do you know like those any example for clock animation . public function createCh...

How do I get monotonic time durations in python?

I want to log how long something takes in real walltime. Currently I'm doing this: startTime = time.time() someSQLOrSomething() print "That took %.3f seconds" % (time.time() - startTime) But that will fail (produce incorrect results) if the time is adjusted while the SQL query (or whatever it is) is running. I don't want to just benc...

Extracting GPU information using C++ (and hopefully WMI?)

Hi everyone! I'd like to know how to extract GPU using C++. However, the information that I'm interested in is not the data that is available from the Win32_VideoController class (ahh.. the Murphy's Laws of Programming). Specifically, I'm interested in the (Memory and Shader clocks). I'd like to know how to get at that information. I'...

How to generate event on a specific time of clock in C#?

How can i generate an event on a specific time say i want to generate alert at 8:00 AM that its 8:00 AM and on any given time of clock ...

Python sched.scheduler exceeds max recursion depth

Hello, I have recently started learning Python and part of the simple app I am making includes a timer with a hh:mm:ss display running in its own thread. Looking around the web I found two ways of implementing this: Using sched.scheduler Using threading.Timer The way I did it looks similar for both implementations: sched: def tic...

Getting a system-clock-change-tick in C#

Is their a way to execute a delegate or event in C# when for instance the seconds, minutes, hours,... change in the system-clock, without using a timer that checks every millisecond if the property has changed and executes the event with a delay of maximum a millisecond. ...

What's the difference between clock(), gettickcount(), QueryPerformanceCounter() and QueryPerformanceFrequency()?

Do they all give millisecond resolution? ...

Boost C++ date_time microsec_clock and second_clock

I discovered a strange result in Boost C++ date time library. There is inconsistency between microsec_clock and second_clock, and I don't understand why is that. I am using Windows XP 32-bits My snip of code: using namespace boost::posix_time; ... ptime now = second_clock::universal_time(); std::cout << "Current Time is: "<< to_iso_ext...

Calculating number of seconds between two points in time, in Cocoa, even when system clock has changed mid-way.

I'm writing a Cocoa OS X (Leopard 10.5+) end-user program that's using timestamps to calculate statistics for how long something is being displayed on the screen. Time is calculated periodically while the program runs using a repeating NSTimer. [NSDate date] is used to capture timestamps, Start and Finish. Calculating the difference b...

wrong results for clock() on 64 bit

Hi all, I've got a simple benchmarking function using the C clock() function. start[timerId]=clock(); clock_t end; float dif_sec; end=clock(); dif_sec=((float)end-start[timerId])/CLOCKS_PER_SEC; printf("%s: %f seconds\n", msg, dif_sec); It's running fine in 32 bits on Mac OS X, but when I compile in 64 bits, the results are all wrong...

How to read number and display it to unix console with pipe symbols.

Hi. Id like to make simple digital clock just from symbols. My idea was to make this template: { System.out.println(" _"); System.out.println("|" + "_"+ "|"); System.out.println("|" + "_" + "|"); } _ |_| |_| BUILD SUCCESSFUL (total time: 0 seconds) _ _ _| | _| |_ | _| ....etc and t...

How Can I Check To See If the User Set His Clock Back?

In my desktop program, I want to check that to see if the user has set his clock back. To do so, I compare the timestamp of certain Operating System files to the current computer date. If any are after what the computer thinks is the current date, then he must have set his clock back. For Windows XP, I have been using such files as: ...

WPF add a clock to my GUI

Simple Request - I want to be able to display the current time within my WPF application window. Are there free controls out there for this? Just need to display the time, nothing else. ...

android.widget.AnalogClock set time

Is there a way to have the android.widget.AnalogClock display a preset time? I don't want to create a custom AnalogClock, I just want the regular one to display a time to my liking. ...

Worst case operating system clock precision?

I am not sure if this question belongs on StackOverflow but here it is. I need to generate a timestamp using C# for some data which is to be transferred from one party to another party and I need to know what is the worst case precision of the system clock in all operating system (Windows, Linux and Unix)? What I need is to figure out t...

How can I measure time in Java not susceptible to System clock changes?

I would like to measure elapsed time in a Java. However differences in System.currentTimeMillis() and (I believe) System.nanoTime() can be changed by external changes eg someone (or the system) altering the system clock. Using network calls is not an option as it's possible very frequent and fast returns are required. Is there a common...

Reformat php date compare function

Hi again fellas! Found the following snippet online and are currently using it in my web application, however it returns time like "0:5:1". I would like it to format the output like a real date, ie: 00:05:01. Guess that there is an embarrassing quick solution to solve this. Here comes the snippet: function getTimeDifference($start, $e...

How to program the TI TMS320C674x real-time clock using C

Intense googeling failed to turn out a single decent example of how to program the RTC. all I could find were examples for the C5000/4000 models, which seems work differently as I was unable to locate any of the header files required to get the sample code to compile. the closest I got was finding the RTC user manual, but it's no...

World time clock with DST support and server sync

I want to include a JavaScript world time clock like http://www.dynamicdrive.com/dynamicindex6/localtime.htm to my homepage but I don't want to change it every time when the DST changes for a time zone. Is it possible to sync it automatically with an official time server so that I can display the current time for different places live an...