Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120016 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 61562 invoked from network); 13 Apr 2023 07:41:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Apr 2023 07:41:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 954E5180506 for ; Thu, 13 Apr 2023 00:41:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 13 Apr 2023 00:41:49 -0700 (PDT) Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-1842df7cb53so16875240fac.10 for ; Thu, 13 Apr 2023 00:41:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681371708; x=1683963708; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=QZQocZ86kQpbpevsluP4U6blQnYWIqNxCpG5Ss7FJgQ=; b=d2fTPPt93U8GhKM8dOOvjWWMlZakT34XBuoH8rbxq/BP2Ok+gZWWoDH72jau9uE+Kc eWp3Su1d6W6bjGGYqZkmA7ezzZNJCMLk1GNvlb9W/a3GpYLu5eqeTmkX1ylagJveI1uS ZoDJYgAuDS149Q315ngD1tpLMSlXu/OUPeOJEK45rlQ8fgqSXyApLr9TFx5Cg4xf6UYs 5mRnSMTCg5kgpsOi1s/ziLiqUmmcG03olPEoZGvLu6tTWyUFzbUN4/RyUzP4qhqVbd1O xiLjFf8LGFjgZ2m2WktLFm79UbUO43N3f5pbUsuiLnjw2bMIfEPUwqkbAmR/661RxwUL BIVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681371708; x=1683963708; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QZQocZ86kQpbpevsluP4U6blQnYWIqNxCpG5Ss7FJgQ=; b=Iv5fZY3vbKjXHDZb8MeC2Ot2tf/4KXnUqEhtrCFfJysBTugN1vrBol4zH6DbCIccNo g+q+0q3bB9X7nWEfeGox7aVdy3eEn7WPyazw2vjbeTmFjuUfGuEL2clfoJlEa6LFFqrw drGxwoaGnXl2daIFNevKfak4j8bYGfIt77xdCXxhh9n81wbgrItLoXphqoyN9XC0Mtte x3iODzxPDyn5BN3zwMUCO63nrqhfOtr+RKq3nFVFila5AKh4CCf0zdonvNyJ2eEdi/Zf dpQvsAyo3W64GtjfiAr7aytH6KDeJLOFnkQvD2I8LDDLus2NFRmLsE4raveLBqhgEWzy sl7w== X-Gm-Message-State: AAQBX9f13mG75Q5HZ4gp9/uU1N3EebsbNYYhhRXTMD0YeYTRj/T/lDPi RbPfXcevRjH3gcD0QnG6Z2l/3FABviXIVJ4v0f8= X-Google-Smtp-Source: AKy350YVhRdv+NW6p6Wu5eIbHyyuRdq4OlvRy0/zuFVRKUWntu7A659I7JzKyzQdLlpSzfHfPJX+O9S0Xnhw/hye48g= X-Received: by 2002:a05:6870:1493:b0:184:5ab4:804f with SMTP id k19-20020a056870149300b001845ab4804fmr354154oab.2.1681371708518; Thu, 13 Apr 2023 00:41:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 13 Apr 2023 09:41:37 +0200 Message-ID: To: Herbert Groot Jebbink Cc: Rowan Tommins , internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: Possible RFC: $_SERVER['REQUEST_TIME_FLOAT'] From: landers.robert@gmail.com (Robert Landers) On Thu, Apr 13, 2023 at 8:53=E2=80=AFAM Herbert Groot Jebbink wrote: > > Op wo 12 apr. 2023 16:04 schreef Rowan Tommins : > > > On Wed, 12 Apr 2023 at 13:25, Herbert Groot Jebbink < > > herbert@groot.jebbink.nl> wrote: > > > >> fallback for REQUEST_TIME and REQUEST_TIME_FLOAT to hrtime seems not > >> possible, hrtime is not based on the actual time, hrtime can be used t= o > >> calculate a duration or so, not to retrieve the actual time itself. > >> > > > > Fair enough, but that makes my first question all the more important: a= re > > there any situations or platforms where generating an hrtime value for > > every request would have a performance penalty? > > > > How does that performance (for everyone) compare with a single call to > > microtime(true) in your application to calculate the duration from > > REQUEST_TIME_FLOAT to start of profiling, with all subsequent profiling > > using hrtime? > > > > ok, valid point, I also found out that setting a REQUEST_TIME_x variable = at > that point is too late, the request has been going on for a while, that's > most likely the reason it's coming from the active SAPI and not from the > current time. > > Thanks for the feedback, I will not file a RFC If you're using php-fpm and nginx, you can set variables in NGINX (fastcgi.conf): fastcgi_param REQUEST_TIME $date_gmt; fastcgi_param REQUEST_TIME_ISO $time_iso8601; then it should be available in the $_SERVER object. I didn't test this, so it might need some experimentation to get it how you want it.