Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101358 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53542 invoked from network); 16 Dec 2017 14:03:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Dec 2017 14:03:30 -0000 Authentication-Results: pb1.pair.com header.from=weltling@outlook.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=weltling@outlook.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain outlook.de designates 40.92.65.54 as permitted sender) X-PHP-List-Original-Sender: weltling@outlook.de X-Host-Fingerprint: 40.92.65.54 mail-oln040092065054.outbound.protection.outlook.com Received: from [40.92.65.54] ([40.92.65.54:27424] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1F/21-21958-0B7253A5 for ; Sat, 16 Dec 2017 09:03:29 -0500 Received: from VE1EUR01FT023.eop-EUR01.prod.protection.outlook.com (10.152.2.52) by VE1EUR01HT040.eop-EUR01.prod.protection.outlook.com (10.152.3.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.302.6; Sat, 16 Dec 2017 14:03:25 +0000 Received: from AM3PR02MB1010.eurprd02.prod.outlook.com (10.152.2.55) by VE1EUR01FT023.mail.protection.outlook.com (10.152.2.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.302.6 via Frontend Transport; Sat, 16 Dec 2017 14:03:25 +0000 Received: from AM3PR02MB1010.eurprd02.prod.outlook.com ([fe80::6054:6257:1f87:86cc]) by AM3PR02MB1010.eurprd02.prod.outlook.com ([fe80::6054:6257:1f87:86cc%14]) with mapi id 15.20.0323.018; Sat, 16 Dec 2017 14:03:25 +0000 To: "internals@lists.php.net" CC: Niklas Keller Thread-Topic: High resolution timer function Thread-Index: AdN2cldZscVt9KEGSeWMgvIhmDaSOA== Sender: Anatol Belski Date: Sat, 16 Dec 2017 14:03:25 +0000 Message-ID: Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=a-anbel@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2017-12-16T14:03:15.6141705Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General x-incomingtopheadermarker: OriginalChecksum:65EEE7CAC47D26E9139AB5EEF23BCC048C94D8D6F9F9650E814937778916B33B;UpperCasedChecksum:C3D38BD0275D9269456498D370A57610DDD2F905AC185EFCA2035DF9A6A7FC14;SizeAsReceived:7700;Count:47 x-ms-exchange-messagesentrepresentingtype: 2 x-tmn: [k2k1xn/cR5JCkL3COrwgt/3afTZEn7+JYswBHhYcsiA5Qxd4EEjerOYbbi96ipcie8t9HYlSvLk=] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VE1EUR01HT040;6:fe7gbTUGctrmKolkpXFfxSIw6jFUCfs+l6MX6K3P3pwicwp7wJl05eiUHQz5tWMu+qprK/6EuL6IdINp6mijrpkItcpenBOGRMkmFAn4XWlk5H1TpQYdSPRcYcPdGNjTLIq7P8NUHONMq9Fv5JGnZPnlqGUaqbXh80vxwX0/kqMrzf532l/O6brMPlp/eq2ZcwagSKxm2SVb6deUZHPRcndXYK23XQPaBxQP9+VaDzx4jGzWRqCnXvBG6UmkBcKUOH1CEQ4sOaTSW416qB/jZMBIbqVFsBhljZTKxIHhkRBSGDGISKWyqa5epEnl6rQP4AnlQS9SwvvSjYrCzYABTNji++jzmv9PiwkaE+fb/8Y=;5:1rqdubMKL0Fnvdu3z85SUtpA28vu1rlZI5m9nsxd4VB2K+Y5KziKYv19tNpckVnhmsymavPRlfUlpPMQqF6801M4ifuP5MoE3v2413mhtAcbSXsWD/gfTIwIOT7lCoJU4DghkqieVOf5mta/UNGi4AIVS0+70u2Ywoay2LkV+4I=;24:l5Sj1vg6RWNtaYYwiFFrCtEoKJ86KUlYHxk69JGYNXgiClLxaVq0ZmpZZ1m1BNVqPZG5wC3iCeRxolCzz1d2byU1JskonvOMzbYZ1ZEaFEE=;7:MQFwMGyy/ITyjP68CGyMGkvQEQCFwuZYUbzuYmm9Cd6eb7oMLBAAlg/W9yxEh4JsEZwvTvWtKunQ9ozQ1jco5p6sWrbsARHSBKucAIaHQw6DIkQT+eQzaqqnmayIasaxr8x+O9A2YLILncYMm7l0duTAOQVc3yyttcpI7/vHxcVcaBBqPLdnfiSQH/Gd663yCe22tFs0g5owrvkpD8wg9ooT9FUz3+J3SzKfshArgNdQi5C2Duewg0cdrmORRiht x-incomingheadercount: 47 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1601125374)(1603101448)(1701031045);SRVR:VE1EUR01HT040; x-ms-traffictypediagnostic: VE1EUR01HT040: x-ms-office365-filtering-correlation-id: a1097605-289c-4e16-f4a2-08d5448dc659 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(444000031);SRVR:VE1EUR01HT040;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:VE1EUR01HT040; x-forefront-prvs: 0523CF0711 x-forefront-antispam-report: SFV:NSPM;SFS:(7070007)(98901004);DIR:OUT;SFP:1901;SCL:1;SRVR:VE1EUR01HT040;H:AM3PR02MB1010.eurprd02.prod.outlook.com;FPR:;SPF:None;LANG:; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1097605-289c-4e16-f4a2-08d5448dc659 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2017 14:03:25.0873 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR01HT040 Subject: High resolution timer function From: ab@php.net (Anatol Belski) Hi, I would like to propose a function for high resolution monotonic timing. Th= ere was discussions about this before and a PR https://github.com/php/php-s= rc/pull/2368 which has issues and was abandoned. I've filed https://github.= com/php/php-src/pull/2976 with some reworked implementation. A monotonic timer can be usable in several situations besides benchmarking.= Having a simple functionality like this in the core should be a useful add= ition. The current approach is a function returning array of [seconds, nano= seconds] and optionally returning full nanosecond number as int on 64-bit o= r float on 32-bit. The first way is the most portable. Quite a few platform= s are already supported by the current implementation. IMHO it should be fine to have a function like this in the core, perhaps al= so a few helper functions could be useful, too. I would like to pursue 7.3 = with this. Please lets check for any concerns in general or with implementa= tion, naming, etc. Regards Anatol