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.

110 questions
0
votes
0 answers

PHP send attachment using PHPMailer - slow execution

currently I'm trying to send emails with file attachements using PHPMailer. Unfortunatelly, each script execution takes approximatelly 60 seconds to send a message. here is my code: $time_start =…
Jakub Pastuszuk
  • 928
  • 4
  • 12
  • 31
0
votes
0 answers

Zend_View_Helper_Partial - performance measure

I am trying to extend the zend partial helper to make it a little faster for my own needs. The code of how I do that is not important at this point. I have created a unit test which acts weird and I can not understand the reason for it this is the…
iosifv
  • 1,153
  • 1
  • 10
  • 26
0
votes
1 answer

Hold time in session and compare the difference

I have a code that I want to check for time differences. This code below will check the the time start and time end then it will display the total time taken. When I first load the page, the time will initialize in session. After that I will wait…
sg552
  • 1,521
  • 6
  • 32
  • 59
0
votes
1 answer

Moving from MySQL 5.5 to GAE with cloud SQL : Microtime support?

Background: I have a project running on Laravel 4 with PHP 5.4.10 and MySQL 5.5 Due to the high performance requirements the Project has most of its business logic in Stored MySQL procedures, and for debugging and logging purposes each procedure…
Johannes
  • 6,232
  • 9
  • 43
  • 59
0
votes
2 answers

timestamp to include milisec php

i have a function that uses current timestamp to fetch some data and sql table, but some data get's doubled because the are in the same second and runs twice. I need to fetch them with timestamp including miliseconds. i use $timestamp =…
user3127632
  • 375
  • 1
  • 5
  • 20
0
votes
3 answers

Find out for how long the script was running for in seconds?

I have a script which runs in a 'while' cycle. I need to determine for how long the script was running for and if it is over 10 seconds terminate it. The code I wrote returns weird decimal values (one second it might be '5.342...' and other it might…
Kristina
  • 15,859
  • 29
  • 111
  • 181
0
votes
2 answers

php microtime() behaving differently

I'm working with an API which calculates a timestamp using the following function: public function timestamp() { return round(microtime(TRUE) * 1000); } But when i call the function on my localhost and on my webhost, i get the following in…
Mads K
  • 847
  • 2
  • 14
  • 32
0
votes
3 answers

Unprecise and random code execution time

I was checking the difference in execution time of these 4 strings with same variable: $name= "rahul"; echo "My name is $name" echo "My name is ".$name; echo "My name is {$name}"; echo "My name is '{$name}'"; But every i tried it i got only 3…
Rahul
  • 1,181
  • 1
  • 11
  • 20
0
votes
1 answer

Can microtime work differently between a unix server and a windows wamp server

i have the following line of code $timestamp = '-'.(int)(microtime(true)*1000); $timestamp gets appended onto the end of an order id to make it more unique, however, while i was testing on my local Wamp Server (on a Windows OS) i was getting values…
Memor-X
  • 2,870
  • 6
  • 33
  • 57
0
votes
1 answer

PHP Float and Double datatype in microtime()

I am trying to understand how the various data types are controlling the way output of microtime() function is displayed? here are the 3 scenarios: 1 . This will display the output of the microtime function in floating format since I have set the…
Neon Flash
  • 3,113
  • 12
  • 58
  • 96
0
votes
1 answer

PHP's Microtime(true) Equivalent For VB.NET?

I am trying to regenerate PHP's microtime(true) in VB.NET to create a microtime (1344004866.8658) although I am not having much luck! I have searched all over the net & cannot seem to find any help around for this one! I am using the following…
Chris
  • 512
  • 1
  • 16
  • 33
-1
votes
1 answer

Need Help Creating BackUp directory

$backuparray = implode("|",$songarray1); file_put_contents("backups/".microtime("tunes.txt"),$backuparray); How do I get my backup directory to link a txt file using microtime , owner id , premissions , and size? The file needs to have…
-1
votes
1 answer

Can't record script time correctly

I have an script that sometimes takes more than 40 seconds to run. But the microtime thing returns less thatn 1 second. First issue is WHY IS THIS TAKING SO LONG???? and second issue is why microtime don't return time correctly?
Alvaro Hernandorena
  • 610
  • 1
  • 5
  • 18
-1
votes
2 answers

how do i format microtime code

I'm having trouble with this php code. not really great at coding. function time() { return round(microtime(true) * 1000); } this dosent work due to php not reading it correctly, and my host wont change precision in php.ini i read somewhere there's…
-1
votes
1 answer

Microtime to Relative Date Conversion

I am receiving the following value from a database which is a millsecond (microtime) value 1369057622.4679 I would like to output this in PHP to be 3 Day's ago Essentially reading the milliseconds value and converting it to a relative date…
Justin Erswell
  • 688
  • 7
  • 42
  • 87