ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/freemol/branches/sync4pymol12/src/mengine/src/minimize.c
(Generate patch)
# Line 53 | Line 53
53     double *xx;  //  xx[maxvar];
54     int method, maxvar;
55     double start_time;
56   struct timeval tv;
56    
57     maxvar = 3*natom;
58     xx = dvector(0,maxvar);
# Line 63 | Line 62
62  
63     if (job_control.monitor)
64       {
65 <     gettimeofday(&tv,NULL);
66 <     start_time = tv.tv_sec + (tv.tv_usec/(double)1000000.0);
65 > #ifdef WIN32
66 >   struct _timeb timebuffer;
67 >   _ftime( &timebuffer );
68 >   start_time = (timebuffer.time+(timebuffer.millitm/((double)1000.0)));
69 > #else
70 >   struct timeval tv;
71 >   gettimeofday(&tv,NULL);
72 >   start_time = tv.tv_sec + (tv.tv_usec/(double)1000000.0);
73 > #endif
74       }
75     else
76       start_time = 0;
# Line 163 | Line 169
169        double fctmin;
170        int restart, terminate;
171        int maxiter, nextiter,status, maxvar;
166      struct timeval tv;
172        double end_time,old_time,ttime;
173  
174        old_time = start_time;
# Line 347 | Line 352
352           // check monitor
353           if (job_control.monitor)
354             {
355 <             gettimeofday(&tv,NULL);
356 <             end_time = tv.tv_sec + (tv.tv_usec/(double)1000000.0);
355 > #ifdef WIN32
356 >        struct _timeb timebuffer;
357 >        _ftime( &timebuffer );
358 >        end_time = (timebuffer.time+(timebuffer.millitm/((double)1000.0)));
359 > #else
360 >        struct timeval tv;
361 >        gettimeofday(&tv,NULL);
362 >        end_time = tv.tv_sec + (tv.tv_usec/(double)1000000.0);
363 > #endif
364               ttime = (end_time-old_time);
365               if ( ttime > 0 &&  (ttime > job_control.interval) )
366                 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines