Questions tagged [time]

Measuring the time it takes to perform an operation. Also, questions related to obtaining the current time, calculating on times, formatting and parsing times, etc.

Measuring the time it takes to perform an operation. Also, questions related to obtaining the current time, calculating on times, formatting and parsing times, etc. See also and .

For analysis in , consider looking at the Time Series Task View.

29686 questions
8
votes
3 answers

Show Real Time, Date, Day of the Week in javascript or jquery

How to show real time, date, day in this format? The time should be actual (which runs the seconds count). Thanks guys!
kgam
  • 217
  • 3
  • 4
  • 12
8
votes
1 answer

How do I replace absolute times ("1:30 PM") with relative times ("15 minutes ago") and have them automatically update?

Is there a Javascript script to change the time and date of blogs automaticly like facebook ??? for example "10 minutes ago" instead of "May 15 2010 12:30". -Thank You
acer
  • 83
  • 3
8
votes
1 answer

JodaTime: plusMonths(1) two times differ from plusMonths(2)

Sample test @Test public void should_be_equals(){ LocalDate now = new LocalDate(2015,01,29); assertThat(now.plusMonths(1).plusMonths(1)).isEqualTo(now.plusMonths(2)); } The strange result: org.junit.ComparisonFailure: Expected…
MariuszS
  • 30,646
  • 12
  • 114
  • 155
8
votes
1 answer

Why is time.clock giving a greater elapsed time than time.time?

I timed a section of python code on Ubuntu using time.clock and time.time: clock elapsed time: 8.770 s time elapsed time: 1.869 s I understand that time.time uses system time and time.clock uses the processor clock. It makes sense to me when…
jmilloy
  • 7,875
  • 11
  • 53
  • 86
8
votes
4 answers

Python multiprocessing doesn't play nicely with uuid.uuid4()

I'm trying to generate a uuid for a filename, and I'm also using the multiprocessing module. Unpleasantly, all of my uuids end up exactly the same. Here is a small example: import multiprocessing import uuid def get_uuid( a ): ## Doesn't help…
yig
  • 329
  • 3
  • 11
8
votes
2 answers

cancel/stop jquery fadeOut after begin

I've got a very simple page that shows a status update when a user clicks on specific entries on the page. This is all working fine. The first click updates the id='sts' with the correct output, after 6 seconds this fades away. However whilst it's…
MacMan
  • 925
  • 1
  • 14
  • 32
8
votes
7 answers

PHP Check if time is between two times regardless of date

I'm writing a script were I have to check if a time range is between two times, regardless of the date. For example, I have this two dates: $from = 23:00 $till = 07:00 I have the following time to check: $checkFrom = 05:50 $checkTill = 08:00 I…
user1393817
  • 294
  • 1
  • 3
  • 12
8
votes
2 answers

Strip time zone part from Time in Ruby

How to strip time zone part from Time leaving date and time parts intact? Currently I am using strftime function. My end goal is to query MySQL with local time for sure. I should be sure that local time won't be suddenly converted to something else.
Paul
  • 25,812
  • 38
  • 124
  • 247
8
votes
1 answer

Trying to use clock_gettime(), but getting plenty of "undeclared" errors from time.h

I am trying to measure the running time of a function using clock_gettime(). I am including time.h, I added -lrt to the Makefile, and added the right path on Eclipse CDT. However, when I try to compile I keep getting these kinds of…
8
votes
1 answer

Is reading a "zero" from memory faster than reading other values?

I am running a memory access experiment in which a 2D matrix was used with each row being the size of a memory page. The experiment consists of reading every element using row/column major and then also writing to each element using row/column…
sherrellbc
  • 4,650
  • 9
  • 48
  • 77
8
votes
1 answer

Converting chr "00:00:00" to date-time "00:00:00"

My question comes from this question. The question had the following character string. x <- "2007-02-01 00:00:00" y <- "02/01/2007 00:06:10" If you try to convert this string to date-class object, something funny happens. This is a sample from…
jazzurro
  • 23,179
  • 35
  • 66
  • 76
8
votes
6 answers

Elapsed time of running a C program

I would like to know what lines of C code to add to a program so that it tells me the total time that the program takes to run. I guess there should be counter initialization near the beginning of main and one after the main function ends. Is the…
yCalleecharan
  • 4,656
  • 11
  • 56
  • 86
8
votes
3 answers

Create a 24 hour vector with 5 minutes time interval in R

Is there any way to create in R a 24 hour vector with 5 minutes time interval from scratch or from an integer format like this: 2355 which would correspond to 23:55 155 which would correspond to 1:55 and so on. Basically what I want is a vector with…
8
votes
3 answers

how to define a loop to be run for some seconds/minutes long

My purpose is to execute a while loop for a defined time (e.g. 90 seconds for this example). It does not have to be exactly 90 s, but 1-2 second inaccuracy is acceptable. I trued to use clock()` function for this purpose: int main(void){ …
Angs
  • 1,605
  • 2
  • 23
  • 47
8
votes
0 answers

Convert Seconds to datetime timedelta

In python how can I simply convert an integer of seconds into (h:m:s) using the datetime module? i.e. 500000 ---> 138:53:20 Please, no tuple hackery.
user3814630
  • 167
  • 1
  • 2
  • 4
1 2 3
99
100