1
1
// SPDX-License-Identifier: Apache-2.0
2
2
// Copyright Contributors to the OpenTimelineIO project
3
3
4
- #include < cstddef>
5
4
#include < iostream>
6
- #include < cstdio>
7
5
8
6
#include " opentimelineio/clip.h"
9
7
#include " opentimelineio/typeRegistry.h"
8
+ #include " opentimelineio/any.h"
9
+ #include " opentimelineio/serialization.h"
10
+ #include " opentimelineio/deserialization.h"
11
+ #include " opentimelineio/timeline.h"
12
+
10
13
#include " util.h"
11
- #include < opentimelineio/any.h>
12
- #include < opentimelineio/serialization.h>
13
- #include < opentimelineio/deserialization.h>
14
- #include < opentimelineio/timeline.h>
15
14
16
15
namespace otio = opentimelineio::OPENTIMELINEIO_VERSION;
17
16
@@ -28,6 +27,11 @@ const struct {
28
27
bool SINGLE_CLIP_DOWNGRADE_TEST = true ;
29
28
} RUN_STRUCT ;
30
29
30
+ // typedef std::chrono::duration<float> fsec;
31
+ // auto t0 = Time::now();
32
+ // auto t1 = Time::now();
33
+ // fsec fs = t1 - t0;
34
+
31
35
// / utility function for printing std::chrono elapsed time
32
36
double
33
37
print_elapsed_time (
@@ -36,16 +40,11 @@ print_elapsed_time(
36
40
const chrono_time_point& end
37
41
)
38
42
{
39
- const auto dur = (
40
- std::chrono::duration_cast<std::chrono::microseconds>(
41
- end - begin
42
- ).count ()
43
- );
43
+ const std::chrono::duration<float > dur = end - begin;
44
44
45
- double result = dur/1000000.0 ;
46
- std::cout << message << " : " << result << " [s]" << std::endl;
45
+ std::cout << message << " : " << dur.count () << " [s]" << std::endl;
47
46
48
- return result ;
47
+ return dur. count () ;
49
48
}
50
49
51
50
void
0 commit comments