Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6319887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:52:45+00:00 2026-05-24T15:52:45+00:00

I’ve tried Google, php.net and the php mailinglist’s archives, but I can’t find what

  • 0

I’ve tried Google, php.net and the php mailinglist’s archives, but I can’t find
what I’m looking for. Maybe it’s obvious, or maybe nobody wonders about
this…

For years, I’ve used microtime() to get the current time including the
microseconds. However, somebody pointed me at a sentence in the manual
page: “This function is only available on operating systems that support
the gettimeofday() system call.”

And PHP’s gettimeofday() suggests the same situation: “This is an
interface to gettimeofday(2).”

But… what kind of systems then don’t have this system call available?
Some googling around provided lots of C programmers trying to get a
gettimeofday() implementation in C on Windows, since it doesn’t seem to
include it. But PHP’s microtime() and gettimeofday() seem to work just
fine on Windows (at least the boxes I could get to). Also, I just can’t
seem to find PHP code anywhere on the web that seems to check the
existence of either microtime() or gettimeofday() before they call it,
and there have to be lots of PHP programmers out there working on
Windows boxes so…

Should I ignore the sentence in the manual and just trust that both
functions are always available? Or is there another cross-platform way
to get to the system time, including the microseconds, without using
microtime() or gettimeofday()? Or will both functions just always exist,
but just not give me microseconds if there is no gettimeofday() system
call available?

EDIT 1:

http://www.php.net/microtime

"Returns the current Unix timestamp with microseconds.
This function is only available on operating systems that 
support the gettimeofday() system call."

Maybe this clarifies my point somewhat.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T15:52:45+00:00Added an answer on May 24, 2026 at 3:52 pm

    According to sources PHP has its own gettimeofday implementation for Windows. But there’s no other ports of gettimeofday available. So except UNIX based systems and Windows, any other operating systems cannot use microtime()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.