回答編集履歴

4

std::timespec_get

2021/12/31 08:21

投稿

int32_t
int32_t

スコア20884

test CHANGED
@@ -24,4 +24,6 @@
24
24
 
25
25
  `ftime()` は2038年以降は使い物にならなくなる環境が多く言語的には非標準なので、[`std::chrono::
26
26
 
27
- steady_clock`](https://cpprefjp.github.io/reference/chrono/steady_clock.html) とか [`std::timespec_get()` ](https://cpprefjp.github.io/reference/ctime/timespec_get.html)を使うほうが将来性は良いのでは。
27
+ steady_clock`](https://cpprefjp.github.io/reference/chrono/steady_clock.html) ~~とか [`std::timespec_get()` ](https://cpprefjp.github.io/reference/ctime/timespec_get.html)~~を使うほうが将来性は良いのでは。
28
+
29
+ (追記: `std::timespec_get()` も2038年問題がありました。)

3

文言

2021/12/31 08:21

投稿

int32_t
int32_t

スコア20884

test CHANGED
@@ -22,6 +22,6 @@
22
22
 
23
23
 
24
24
 
25
- 言語的には非標準の `ftime()` 使うよりは、[`std::chrono::
25
+ `ftime()` は2038年以降は使い物にならなくなる環境が多く言語的に非標準なので、[`std::chrono::
26
26
 
27
27
  steady_clock`](https://cpprefjp.github.io/reference/chrono/steady_clock.html) とか [`std::timespec_get()` ](https://cpprefjp.github.io/reference/ctime/timespec_get.html)を使うほうが将来性は良いのでは。

2

文言

2021/12/31 08:17

投稿

int32_t
int32_t

スコア20884

test CHANGED
@@ -2,9 +2,19 @@
2
2
 
3
3
 
4
4
 
5
- いい
5
+ 。問題はなと思います
6
6
 
7
+
8
+
9
+ コード可読性的には、
10
+
11
+ ```c++
12
+
13
+ (end.time + end.millitm * 0.0001) - (start.time - start.millitm * 0.0001);
14
+
15
+ ```
16
+
7
- (TODO: 後で理由を書く)
17
+ のほうがちょっと良いかもしれません。
8
18
 
9
19
 
10
20
 

1

文言

2021/12/31 08:12

投稿

int32_t
int32_t

スコア20884

test CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
 
4
4
 
5
- い。
5
+ いえ
6
+
7
+ (TODO: 後で理由を書く)
6
8
 
7
9
 
8
10
 
@@ -10,6 +12,6 @@
10
12
 
11
13
 
12
14
 
13
- とはいえ、言語的には非標準の `ftime()` を使うよりは、[`std::chrono::
15
+ 言語的には非標準の `ftime()` を使うよりは、[`std::chrono::
14
16
 
15
17
  steady_clock`](https://cpprefjp.github.io/reference/chrono/steady_clock.html) とか [`std::timespec_get()` ](https://cpprefjp.github.io/reference/ctime/timespec_get.html)を使うほうが将来性は良いのでは。