Questions tagged [microtime]

Anything related to programming languages functions (or other similar facilities) allowing the retrieval of the current time with a resolution in the microseconds range.

Anything related to programming languages functions (or other similar facilities) allowing the retrieval of the current time with a resolution in the microseconds (µs) range.

103 questions
1
vote
1 answer

Something goes wrong with PHP microtime parsing

Ok, I have this basics PHP logic made for measuring execution time in PHP, you can find it here. Everything was right, than I, instead of usual time execution range and format suddenly started to get incorrect results, like this: This page was…
Miloš Đakonović
  • 3,241
  • 4
  • 29
  • 48
0
votes
3 answers

How do I print the timing of a for loop before the output of the loop?

I don't know if the title is correct, anyway here is what I need: This is my code: $start = microtime(); $string = $_POST['string']; $matches = $SQL->prepare("SELECT * FROM `users` WHERE `name` LIKE…
Rym
  • 77
  • 1
  • 1
  • 7
0
votes
2 answers

Jquery - How can i create a datetime in microformat

what ist the fastest way to create this date format with javascript/jquery? Wed, 03 Aug 2011 15:49:22 -0700 Thanks in advance! Peter
Peter
  • 9,629
  • 29
  • 90
  • 143
0
votes
2 answers

Angular 9 Issue: Unable to run the initial application

Can someone help me to resolve the following issue? I am following the https://v8.angular.io/guide/setup-local#prerequisites document to set up the initial application on my windows machine but facing an issue. OS: Windows 10, 64-bit Issue: npm…
rockey91
  • 122
  • 2
  • 10
0
votes
1 answer

Weird Issue on a benchmark in PHP

I have wrote this snippet to test the time that it takes to cast a string to integer and I tried this one here for fun but the result was so interesting.
0
votes
1 answer

How to get missing time to a microtime from another one, formatted (H:i:S) with PHP?

i am new to stackOverflow, i was wondering how could i get the missing time date to a microtime(true) starting from another microtime(true), and get it formatted like that (H:i:s). This is my code: $rewardCountdown = microtime(true) -…
HerryYT
  • 15
  • 7
0
votes
2 answers

Stop execution till the beginning of the next hour

I successfully find (i think) how many microseconds have to pass till the beginning of the next hour but usleep() function shows warning Number of microseconds must be greater than or equal to 0 $min = (integer)date('i'); $sec =…
Professor Chaos
  • 195
  • 1
  • 7
0
votes
1 answer

Convert microtime(true) to javascript date object

Can the value of PHP's microtime(true) be converted to a javascript date object, and the accuracy to be preserved ?
Alex
  • 60,472
  • 154
  • 401
  • 592
0
votes
0 answers

microtime showing 1.52214531583E+12

I am using round(microtime(true) * 1000); for generating current timestamp in 13 digits. But it is not returning me correct 13 digit values instead it return something like this: 1.52214531583E+12 which is not useful in my case. How can i convert…
Paritosh Mahale
  • 923
  • 2
  • 8
  • 32
0
votes
2 answers

Update Input field value with javascript

I am trying to build a javascript function that will update an input field every second with a new number. This is essentially what I'm hoping my function can do, and hopefully someone can give me a pointer about what I'm doing wrong.