time

thread synchronization

let's say i have a blocking method , let's call in Block(). as i don't want my main thread to block i might create a worker thread, that instead will call Block. however, i have another condition. i want the call to block to return in 5 seconds top, otherwise, i want to let the main thread know the call to Block failed and to exit the...

Blackberry - Set Time part of Date to the Start of a Day (12:00 AM)

Hi, As i am working on a reminder application, i need to show the reminder dialog whenever the set date has arrived for a particular data. I am using the following code to store the date. long now = System.currentTimeMillis(); DateField dateField = new DateField("",now,DateField.DATE); long date = dateField.getDate(); For example,...

Python date formatting without space?

How to display the following without any space also could we substitute a separator instead of space? > log_time=datetime.datetime.now() > print log_time 2009-12-16 16:10:03.558991 ...

how get php total time?

hello all, i have created work total time program in PHP - give input time - 1.30, 2.10, 1.40 and get output time - 4.80(8 hrs). but i need output time - 5.20(8.40 hrs). Notes: 1.30+2.10+1.40=4.80(8 hrs), but i need 5.20(8.40 hrs). please help me... ...

how to get seconds from java long, I'm storing it in mssql DB as bigint

I store the long values in mssql using bigint so I could do something like this: --@start and @end are bigint set @duration = @start - @end now I need some additional operation so I could get the duration in seconds, anybody knows how ? ...

Tornado Web Framework Mysql connection handling

I have recently been exploring the Tornado web framework to serve a lot of consistent connections by lots of different clients. I have a request handler that basically takes an RSA encrypted string and decrypts it. The decrypted text is an XML string that gets parsed by a SAX document handler that I have written. Everything works perf...

How to format datetime most easily in PHP?

To change 2009-12-09 13:32:15 to 09/12/2009 ...

C++ Vector vs Array (Time)

I have got here two programs with me, both are doing exactly the same task. They are just setting an boolean array / vector to the value true. The program using vector takes 27 seconds to run whereas the program involving array with 5 times greater size takes less than 1 s. I would like to know the exact reason as to why there is such a ...

Timestamp to internal day count

On one project, I have an internal calculation of times. The days since the launch are simply enumerated: 2009/10/19: launch day 2009/10/20: day 1 2009/10/21: day 2 etc. Now I would like to have a function which gives me the current day of the internal calculation of times. E.g. "day 129" on one day in 2010. But it is important to ha...

High-precision clock in Python

Is there a way to measure time with high-precision in Python --- more precise than one second? I doubt that there is a cross-platform way of doing that; I'm interesting in high precision time on Unix, particularly Solaris running on a Sun SPARC machine. timeit seems to be capable of high-precision time measurement, but rather than meas...

Formatting a period of time

In Java I have a long integer representing a period of time in milliseconds. The time period could be anything from a couple of seconds to a number of weeks. I would like to output this time period as a String with the appropriate unit. For example 3,000 should be output as "3 seconds", 61,200,000 should be output as "17 hours" and 1,81...

Upper limit in Python time.sleep()?

Is there an upper limit to how long you can specify a thread to sleep with time.sleep()? I have been having issues with sleeping my script for long periods (i.e., over 1k seconds). This issue has appeared on both Windows and Unix platforms. ...

compare date/time via VBA with date/time in Access DB

Hi, How to compare a date/time via VBA with a date/time in an Access DB? The query I use adoRS.Open "SELECT * FROM currentpositions WHERE ((currentpositions. [dateLT])=" & "#" & date_from_message & "#" & ")", adoConn, adOpenStatic, adLockOptimistic I only achieve to compare a date. Anybody an idea? Regards Camastanta ...

How to format "time with time zone" in Postgres?

I have a database field of type time with time zone. How can I query this field in EST5EDT time zone with the output format hh:mm:ss? All I can find is using multiple calls to EXTRACT: SELECT EXTRACT(HOUR FROM TIME WITH TIME ZONE '20:38:40-07' AT TIME ZONE 'EST5EDT'); [Edit:] To be clear, this query: SELECT TIME WITH TIME ZONE '...

.NET QueryPerformanceCounter printing the day time

Hello, I need to format the day time using QueryPerformanceCounter Win32 API. The format, is: HH:mm:ss.ffffff , containing hours minuts seconds and microseconds. I need to use THIS function, because another process (written in C) is using this function and the purpose is using the same function in both places. Thanks ...

How to know calculate the execution time of an algorithm in c++?

Hi, I want to test which data structure is the best by looking at the run-time performance of my algorithm, how do I do it? For example I already have a hashmap<string, int> hmp; assuming I have "apple" in my hashmap I want to know how long the following statement takes to execute: hmp["apple"]. How can I time it? Thanks! ...

Thread-safe timezone-specific time display in C/C++

I have a multi-threaded application which needs to display certain dates to the user. The dates are stored using UTC Unix time values. However, the date must be displayed in the time zone of the user, not the local server time or UTC. Basically, I need a function like this: struct tm *usertime_r(const time_t *timer, struct tm *result, c...

Does PHP's date() function return the date and time on the server or on the client's computer?

Does PHP's date() function return the date and time on the server or on the client's computer? ...

Get the percentage of the page load using javascript?

Hi guys, I'm writing an iphone application and need to show a progress bar that shows the loading progress of a web page. I want to insert a JS function to this page and once I call it, it will give me the load progress (how much bytes have been loaded and the total size). Is this possible? Thanks ...

When seconds come x, do something

How I will do that: When seconds come 31 (example 11:57 31sec.) do somthing, every minute. Using Javasript. Thanks in advance. ...