Skip to main content
added 5 characters in body
Source Link
Jamal
  • 34.9k
  • 13
  • 133
  • 237

There isn't much more to improve after the code has begun to accept function parameters.

These are some details, you could freely ignore them:

  • Class names should begin with an uppercase letter

    struct Measure

     struct Measure
    
  • You don't need the duration variable; just do:
    return std::chrono::duration_cast< TimeT>(std::chrono::system_clock::now() - start).count();

     return std::chrono::duration_cast< TimeT>(std::chrono::system_clock::now() - start).count();
    

There isn't much more to improve after the code has begun to accept function parameters.

These are some details, you could freely ignore them:

  • Class names should begin with an uppercase letter

    struct Measure

  • You don't need the duration variable; just do:
    return std::chrono::duration_cast< TimeT>(std::chrono::system_clock::now() - start).count();

There isn't much more to improve after the code has begun to accept function parameters.

These are some details, you could freely ignore them:

  • Class names should begin with an uppercase letter

     struct Measure
    
  • You don't need the duration variable; just do:

     return std::chrono::duration_cast< TimeT>(std::chrono::system_clock::now() - start).count();
    
Source Link
edmz
  • 1k
  • 7
  • 16

There isn't much more to improve after the code has begun to accept function parameters.

These are some details, you could freely ignore them:

  • Class names should begin with an uppercase letter

    struct Measure

  • You don't need the duration variable; just do:
    return std::chrono::duration_cast< TimeT>(std::chrono::system_clock::now() - start).count();