Ignore:
Timestamp:
Dec 5, 2012, 10:26:54 PM (13 years ago)
Author:
gobi
Message:

fixing spaces, tabs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cppstreams/test_fibonacci.cc

    r3 r16  
    99 * Redistribution and use in source and binary forms, with or without 
    1010 * modification, are permitted provided that the following conditions are met: 
    11  * 1. Redistributions of source code must retain the above copyright  
     11 * 1. Redistributions of source code must retain the above copyright 
    1212 *    notice, this list of conditions and the following disclaimer. 
    13  * 2. Redistributions in binary form must reproduce the above copyright  
     13 * 2. Redistributions in binary form must reproduce the above copyright 
    1414 *    notice, this list of conditions and the following disclaimer in the 
    1515 *    documentation and/or other materials provided with the distribution. 
     
    5252int main() 
    5353{ 
    54         stream<long> s = 0l<<=s+(1l<<=s); 
    55     compare(s,  {0l,1l,1l,2l,3l,5l,8l,13l,21l,34l}, 1); 
     54  stream<long> s = 0l<<=s+(1l<<=s); 
    5655 
    57     const int n = 200000; 
    58     struct timeval tv1, tv2; 
    59     struct timezone tz; 
     56  compare(s,  {0l,1l,1l,2l,3l,5l,8l,13l,21l,34l}, 1); 
    6057 
    61     gettimeofday(&tv1, &tz); 
    62     stream<long>::iterator it = s.begin(); 
    63     for(int i=0; i<n; ++i) ++it; 
    64     *it;  
    65     gettimeofday(&tv2, &tz); 
    66     std::cout<<timeval_diff(tv2, tv1)<<std::endl; 
     58  const int n = 200000; 
     59  struct timeval tv1, tv2; 
     60  struct timezone tz; 
    6761 
    68     gettimeofday(&tv1, &tz); 
    69     fib(n); 
    70     gettimeofday(&tv2, &tz); 
    71     std::cout<<timeval_diff(tv2, tv1)<<std::endl; 
     62  gettimeofday(&tv1, &tz); 
     63  stream<long>::iterator it = s.begin(); 
     64  for(int i=0; i<n; ++i) ++it; 
     65  *it; 
     66  gettimeofday(&tv2, &tz); 
     67  std::cout<<timeval_diff(tv2, tv1)<<std::endl; 
    7268 
    73         return 0; 
     69  gettimeofday(&tv1, &tz); 
     70  fib(n); 
     71  gettimeofday(&tv2, &tz); 
     72  std::cout<<timeval_diff(tv2, tv1)<<std::endl; 
     73 
     74  return 0; 
    7475} 
Note: See TracChangeset for help on using the changeset viewer.