Deutsch English Français Italiano |
<vjr73j$1j9tc$1@raubtier-asyl.eternal-september.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail From: Bonita Montero <Bonita.Montero@gmail.com> Newsgroups: comp.lang.c++ Subject: Re: g++ v14.1.0 Date: Tue, 17 Dec 2024 07:52:37 +0100 Organization: A noiseless patient Spider Lines: 30 Message-ID: <vjr73j$1j9tc$1@raubtier-asyl.eternal-september.org> References: <vjqvhu$305fb$1@paganini.bofh.team> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 17 Dec 2024 07:52:37 +0100 (CET) Injection-Info: raubtier-asyl.eternal-september.org; posting-host="723c258aebffb2b72c8f49f923671347"; logging-data="1681324"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/gcHqZwcPanDqluEV3XZ2eUB/sp26Qrk4=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:l50Rpb8MKgHwePVgmjYEvDYBxIg= In-Reply-To: <vjqvhu$305fb$1@paganini.bofh.team> Content-Language: de-DE Bytes: 1846 Am 17.12.2024 um 05:39 schrieb Student Project: > Do you guys see any problems in this simple code: > struct Timer > { > std::chrono::time_point<std::chrono::steady_clock> start, end; > std::chrono::duration<float> duration; > > Timer() > { > start = std::chrono::high_resolution_clock::now(); std::chrono::time_point<std::chrono::high_resolution_clock> start, end; > } > > ~Timer() > { > end = std::chrono::high_resolution_clock::now(); > duration = end - start; > > float ms = duration.count() * 1000.0f; > std::cout << "Timer took: " << ms << "ms\n"; > } > }; > That's while steady_clock and system_clock are the same with MSVC (both rely on GetSystemTimeAsFileTime()).