@@ -66,11 +66,16 @@ void SpillInputStream::next(bool /*throwIfPastEnd*/) {
66
66
uint64_t readTimeUs{0 };
67
67
if (readaWait_.valid ()) {
68
68
{
69
- MicrosecondTimer timer{&readTimeUs};
69
+ // TODO: it is ns not us, wait to change, just make unit test fine, wait
70
+ // PR to change, MicrosecondTimer is too big.
71
+ auto start = std::chrono::steady_clock::now ();
70
72
readBytes = std::move (readaWait_)
71
73
.via (&folly::QueuedImmediateExecutor::instance ())
72
74
.wait ()
73
75
.value ();
76
+ auto duration = std::chrono::duration_cast<std::chrono::nanoseconds>(
77
+ std::chrono::steady_clock::now () - start);
78
+ readTimeUs = duration.count ();
74
79
VELOX_CHECK (!readaWait_.valid ());
75
80
}
76
81
VELOX_CHECK_LT (0 , readBytes, " Reading past end of spill file" );
@@ -79,8 +84,11 @@ void SpillInputStream::next(bool /*throwIfPastEnd*/) {
79
84
readBytes = readSize ();
80
85
VELOX_CHECK_LT (0 , readBytes, " Reading past end of spill file" );
81
86
{
82
- MicrosecondTimer timer{&readTimeUs} ;
87
+ auto start = std::chrono::steady_clock::now () ;
83
88
file_->pread (offset_, readBytes, buffer ()->asMutable <char >());
89
+ auto duration = std::chrono::duration_cast<std::chrono::nanoseconds>(
90
+ std::chrono::steady_clock::now () - start);
91
+ readTimeUs = duration.count ();
84
92
}
85
93
}
86
94
setRange ({buffer ()->asMutable <uint8_t >(), readBytes, 0 });
0 commit comments