LCOV - code coverage report
Current view: top level - tests/xtime - test_nanotime.cpp (source / functions) Hit Total Coverage
Test: faslib-coverage.info Lines: 19 19 100.0 %
Date: 2019-12-03 13:22:31 Functions: 3 3 100.0 %

          Line data    Source code
       1             : //
       2             : // Author: Vladimir Migashko <migashko@gmail.com>, (C) 2011
       3             : //
       4             : // Copyright: See COPYING file that comes with this distribution
       5             : //
       6             : 
       7             : #include <iostream>
       8             : #include <cstdio>
       9             : #include <fas/xtime.hpp>
      10             : #include <fas/system/system.hpp>
      11             : 
      12             : using namespace fas;
      13             : 
      14             : //#define MAX_I 10000000
      15             : 
      16           1 : int main()
      17             : {
      18           1 :   nanospan start = nanotime();
      19           1 :   if (start == nanospan(0) ) return 1;
      20           1 :   fas::system::sleep(100);
      21           1 :   nanospan finish = nanotime();
      22           1 :   if (finish == nanospan(0) ) return 2;
      23           1 :   if (finish == start) return 3;
      24           1 :   std::cout << start << std::endl;
      25           1 :   std::cout << finish << std::endl;
      26             : 
      27           1 :   start = process_nanotime();
      28           1 :   if (start == nanospan(0) ) return 4;
      29           1 :   fas::system::sleep(100);
      30           1 :   finish = process_nanotime();
      31           1 :   if (finish == nanospan(0) ) return 5;
      32           1 :   std::cout << start << std::endl;
      33           1 :   std::cout << finish << std::endl;
      34           1 :   if (finish == start) return 6;
      35           1 :   return 0;
      36           3 : }
      37             : 
      38             : 

Generated by: LCOV version 1.13