ADT
        ast-experimental
        pthread-emulation
        qualifiedEnum
      
      
        
          | Last change
 on this file since cce4648 was             a5d1fe7, checked in by caparsons <caparson@…>, 4 years ago | 
        
          | 
added mutexStmt benchmarks
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            333 bytes | 
      
      
| Rev | Line |  | 
|---|
| [a5d1fe7] | 1 | #include <cstdio> | 
|---|
|  | 2 | #include <mutex> | 
|---|
|  | 3 | #include "bench.h" | 
|---|
|  | 4 | #include "cppLock.hpp" | 
|---|
|  | 5 |  | 
|---|
|  | 6 | cpp_test_spinlock l1; | 
|---|
|  | 7 |  | 
|---|
|  | 8 | int main( int argc, char * argv[] ) { | 
|---|
|  | 9 | BENCH_START() | 
|---|
|  | 10 | BENCH( | 
|---|
|  | 11 | for ( size_t i = 0; i < times; i++ ) { | 
|---|
|  | 12 | std::scoped_lock lock(l1); | 
|---|
|  | 13 | }, | 
|---|
|  | 14 | result | 
|---|
|  | 15 | ) | 
|---|
|  | 16 | printf( "%g\n", result ); | 
|---|
|  | 17 | } | 
|---|
|  | 18 |  | 
|---|
|  | 19 | // Local Variables: // | 
|---|
|  | 20 | // tab-width: 4 // | 
|---|
|  | 21 | // End: // | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.