#line 24 "/home/travis/build/felix-lang/felix/src/packages/time.fdoc"
  
  class PosixTime
  {
    requires Posix_headers::sys_time_h;
  
    private type time_t = "time_t";
    private type suseconds_t = "suseconds_t";
  
    private fun _ctor_double: time_t -> double = "static_cast<double>($1)";
    private fun _ctor_double: suseconds_t -> double = "static_cast<double>($1)";
  
    private cstruct timeval {
      tv_sec: time_t;
      tv_usec: suseconds_t;
    };
  
    private proc gettimeofday: &timeval = "gettimeofday($1, NULL);";
  
    inherit Time_class[Posix];
  
    instance Time_class[Posix] {
      gen time () : double = {
        var tv:timeval;
        gettimeofday(&tv);
        return tv.tv_sec.double + tv.tv_usec.double / 1.0e6;
      }
    }
  }