clock

Android: Widget updating a clock with custom images as numbers

What way is most efficient for updating an widget that will be a clock(Timer/Alarm), but for a clock to really works, like a clock it would be needed to update at least twice in a minute (30 sec period or less). But that can't be effective? Have looked at some of the "threads/topics" here at StackOverFlow but haven't found any informat...

PHP time function giving wrong time?

On my website, I use the php time() function to display the time. A week ago I compared the time difference between the time returned by the time() function and the time on my computer(I use windows). The time difference was about a minute and 10 seconds but now I checked again and the time difference has grown to a minute and 50 seconds...

Intent to launch the clock application on android

Hello, I am facing a problem with a clock widget i made. I want the user to touch the clock and launch the clock app on the phone. this is the code: //this worked on my nexus 2.1 if(VERSION.SDK.equals("7")){ RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget); Intent AlarmClockIntent ...

C++ clock() function giving incorrect values

I was trying to program a Timer class (unaware that boost had one), then when that wasn't working, I tried to just output the value of clock(), using this code: #include <ctime> #include <iostream> int main() { for(int i = 0; i < 50; ++i) { std::cout << std::clock() << " "; } return 0; } When I run the program, I get a series o...

Linux clock_gettime(CLOCK_MONOTONIC) strange non-monotonic behavior

Folks, in my application I'm using clock_gettime(CLOCK_MONOTONIC) in order to measure the delta time between frames(a typical approach in gamedev) and from time to time I'm facing a strange behavior of clock_gettime(..) - returned values occasionally are not monotonic(i.e prev. time is bigger than current time). Currently, if such a pa...

How to reset Ada.Real_Time.Clock?

Hi, when reading Ada.Real_Time.Clock right after power-up it shows a value that isn't close to zero and sometimes even negative. As far as I know Ada.Real_Time.Clock suppose to reset on power-up. How can I reset Ada.Real_Time.Clock? Thanks. ...

Android: How to start an activity at a specified time?

I'm making an alarm clock of sorts, and I was wondering what the best way to start an activity at a certain time would be. Would it be using the broadcast service or... ...

millisecond-accurate benchmarking in C++?

I do not really wish to profile because I was wanting to do many different small benchmarks on different simple functions. For the life of me I cannot find a way to record the amount of milliseconds in C++, I am using Linux by the way. Can you suggest the method to get the system clock in milliseconds (I may settle with seconds if I can...

What's the most accurate way of measuring elapsed time in a modern PC?

I know I can use IRQ0, which is the system timer, but this is based on a 14.31818MHz clock, right? Is there anything offering greater precision? Thanks. Edit: Does anyone know what the Windows function QueryPerformanceCounter uses? ...

Android 1.5: Implement clock widget using pictures as numbers , and getting user location

Hi everyone, I'm trying to code a clock widget in Android 1.5 for my application, which uses images as the numbers, and updates every second. I'm hoping to have the clock widget extend the View class, so I can use it directly in the layout.xml files. I need some help/tutorials on getting started on the clock, and also about how to get ...

My clock never makes it past 8 seconds

So, I'm making a simple clock that just counts time from a static starting point. The problem is, when the second mark hits 8, it resets to 0. I can't figure out why. Help! Here's the clock: http://jsfiddle.net/Ender/jMbem/ Here's the code for it: HTML: <h1>Mark's Busted Computer Clock</h1> <div id="time"> <span id="hour">146<...

Measuring time taken by a function: clock_gettime

Hi, I am trying to measure how long a function takes. I have a little issue: although I am trying to be precise, and use floating points, every time I print my code using %lf I get one of two answers: 1.000... or 0.000.... This leads me to wonder if my code is correct: #define BILLION 1000000000L; // Calculate time taken by a reques...

JRE clock is different (one hour ahead) than system date

Hello All, I have a windows server 2003 machine, installed on it, a cisco product called "Cisco Voice Portal", this product runs on JRE version 1_5_0_12. Getting the date/time either by: new Date(); or Calendar.getInstance(); always the date is one hour ahead of the system date. At first, i thought it is a timezone mismatch, howeve...

How to obtain user input on a clock interface

We would like to capture the user input pertaining to the hour & minute hands on a clock. What kind of clock interfaces are available to achieve this? (e.g. select 9.30 AM on the clock or select 3.45 PM on the clock) ...

Impact of "kernel: Clocksource tsc unstable" on a GUI application

I have this Java GUI application which uses OpenGL and Eclipse RCP + SWT running on a Linux (Fedora 7) machine equipped with Pentium P or Core 2 Duo CPU. It supposed to run and accept user input for months. After a few weeks of running the whole interface freezes without reason. Mouse is very slow and keyboard stops responding shortly....

Simplest way to show a clock in C++ and Linux.

I'm using C++ under Linux compiling with standard GCC. In my program I want to add a simple clock showing HH:MM:SS. What's the easiest way to do that? ...

How accurate is the GPS Clock ?

In my company we do have critical systems that require an accurate time. As so, we have an NTP server appliance with an outdoor GPS antenna that receives the time from the GPS satellites. My questions are: How accurate is the time clock? Is it worth it to keep this way or use another external NTP (US-GOV, NASA, etc) ? Thanks, ...