time

What does the SBCL time function return?

I'm trying to time an order statistic function implemented in SBCL. Googling around I found this timing function: (time form). However I'm not sure what it returns. It seems to be a large number but I can't find documentation specifying if the return value is milliseconds, nanoseconds, system time, etc. Does anyone know? ...

Segmentation fault on time(0);

Hi! I'm rewriting an old program to do some new stuff, and suddenly I get a segmentation fault error on the following line of code: time_t seconds_since_time_begun = time(0); Why, oh why? Update: I have included the time.h header file in my code, and when I tried what pmg suggested below, both variables were 4 in size. When I tried...

C++ Keeping track of how many seconds has passed since start of program

I am writing a program that will be used on a Solaris machine. I need a way of keeping track of how many seconds has passed since the start of the program. I'm talking very simple here. For example I would have an int seconds = 0; but how would I go about updating the seconds variable as each second passes? It seems that some of the var...

Convert Seconds Integer To HH:MM, iPhone

Hi there, I am struggling with this. I have a value in seconds that I want to display in a label in HH:MM format. I have searched the internet for ages and found some answers, but either not fully understood them, or they seem like an odd way of doing what I want. If someone could help me out on this one that would be great! Bear in min...

Formatting time on Android, while following preferences (24 hr clock vs. AM/PM, etc..)

I'm currently using the following code to format time on Google Android: DateFormat.getDateTimeInstance().format(millis) While this code honors my timezone and locale settings, it ignores the '24 hour mode' setting in system preferences, always returning time in AM/PM. Is there any way to get time in the same format as that on the sta...

Restrict time limit while uploading file + php

Hi, How to restrict a file upload time limit in php i.e I have to upload only video files which are of time 1 and 4 minutes if user upload more than 6 minutes only 4 min file will be uploaded on server. ...

Regex for timestamps in php

I'm trying to take timestamps in this format: 2009-11-16T14:05:22-08:00 and make turn them into something like 2009-11-16 How do I remove everything after the "T"? ...

Testing time critical code

I've written a feature for my library Rubikon that displays a throbber (a spinning as you may have seen in other console apps) as long as some other code is running. To test this feature I capture the output of the throbber in a StringIO and compare it with the expected value. As the throbber is only displayed as long as the other code...

How to use Python to calculate time

I want to write python script that acts as a time calculator. For example: Suppose the time is now 13:05:00 I want to add 1 hour, 23 minutes, and 10 seconds to it. and I want to print the answer out. How do I do this in Python? What if date is also involved? ...

Auto Fill the Time in infopath

I would like to know if there is a way that I can have the time be auto filled when the user enters 10 I then want it to show 10:00. how can I do this? ...

How can I have a function perform after a set amount of time?

I'm creating a site where users can bid on items in a silent auction. I want to be able to somehow start a timer and then let users bid on the items. Once the timer reaches a certain number, I want to be able to remove the bid feature on the auction items. Does anyone know the best approach for me to do this and what functions or plugin...

Convert a summer date to utc in the winter?

The function mktime takes a struct tm as argument. One of the members of struct tm is tm_isdst. You can set this to 1 for wintertime, 0 for summertime, or -1 if you don't know. However, if during winter, you try to convert 2009-09-01 00:00, mktime fails to see that although it is currently winter, the date you are converting is summert...

System.currentTimeMillis() returns always 0 on Motorola Droid

The call to System.currentTimeMillis() returns always 0 on Motorola Droid, Android 2.0. There is no mentioning in changes to System in the API differences between 2.0 and 1.5, so either it was missed somehow or this is a Droid dependency. Does anyone know how to get the currentTimeMillis in a way that satisfies Android 1.5, Android 2.0,...

How can my Ruby "Time.now" timings be so low when my "ping" timings are so high?

I'm using MongoDB for the first time and trying to time its performance. I'm running ruby on a VirtualBox Ubuntu 9.10 guest with a Windows 7 64-bit host. MongoDB is on a remote host, not on my lan buit somewhere in the internet cloud. Here's my code: time1 = Time.now rows = coll.find(some_criteria) puts ((Time.now - time1) * 1000)....

CPU running time of a portion of code

Hi I would like to know the CPU time used by a portion of code.( I am aware of the time command in linux, but that would give me the running time of the complete program, not a portion of it.) Is there any function/command that can help me achieve this. Thanks ...

Measuring online time on website

Hello! I would like to measure how much time a user spends on my website. It's needed for a community site where you can say: "User X has been spending 1397 minutes here." After reading some documents about this, I know that there is no perfect way to achieve this. You can't measure the exact time. But I'm looking for an approach which...

How get hours:minutes

Hi, I have a script here (not my own) which calculates the length of a movie in my satreceiver. It displays the length in minutes:seconds I want to have that in hours:minutes What changes do I have to make? This is the peace of script concerned: if len > 0: len = "%d:%02d" % (len / 60, len % 60) else: len = "" res = [ None ] I...

Is there an API for time zones based on IP address?

i want an API of time zones which is based on IP address to be used in php. ...

[objective-C] get time between two times of the day

Hey, I've already tried with NSDate but with no luck. I want the difference between for example 14:10 and 18:30. Hours and minutes. I Hope you can help me shouldn't be that complicated :) ...

Get Diffrence Between Two Times (Unix Epoc)

You know when it's late in the night and your brain is fried? I'm having one of those nights right now, and my function so far is not working as it should, so please take a look at it: (I should note that I'm using the PHP 5.2.9, and the function / method DateTime:Diff() is not available until PHP 5.3.0. <?php function time_diff($ts...