You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/11/25 07:42:39 UTC

[GitHub] [tvm] FrozenGene commented on a change in pull request #6972: [AutoScheduler] Print the time used for measurement

FrozenGene commented on a change in pull request #6972:
URL: https://github.com/apache/tvm/pull/6972#discussion_r530162124



##########
File path: src/auto_scheduler/utils.h
##########
@@ -253,6 +254,16 @@ inline std::string Chars(const char& str, int times) {
   return ret.str();
 }
 
+/*! \brief Print the time elapsed */
+inline void PrintTimeElapsed(std::chrono::time_point<std::chrono::high_resolution_clock> t_begin,

Review comment:
       I think it is a little strange to pass the `t_begin` and elapse the duration time. I would suggest we pass the `duration` to `PrintElapsedTime` (this name should be better, but current fn name is ok too).
   
   i.e. 
   ```cpp
   double duration = std::chrono::duration_cast<std::chrono::duration<double>>(
                           std::chrono::high_resolution_clock::now() - t_begin)
                           .count();
   inline void PrintElapsedTime(double duration, int verbose) {
     StdCout(verbose) << "Time elapsed: " << std::fixed << std::setprecision(2) << duration << " s"
                      << std::endl;
   }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org