~ubuntu-branches/ubuntu/trusty/blender/trusty-proposed

« back to all changes in this revision

Viewing changes to intern/cycles/util/util_time.cpp

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2013-08-14 10:43:49 UTC
  • mfrom: (14.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20130814104349-t1d5mtwkphp12dyj
Tags: 2.68a-3
* Upload to unstable
* debian/: python3.3 Depends simplified
  - debian/control: python3.3 Depends dropped
    for blender-data package
  - 0001-blender_thumbnailer.patch refreshed
* debian/control: libavcodec b-dep versioning dropped

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
        return now.tv_sec + now.tv_usec*1e-6;
59
59
}
60
60
 
 
61
/* sleep t seconds */
61
62
void time_sleep(double t)
62
63
{
63
 
        if(t >= 1.0)
64
 
                sleep((int)t);
65
 
 
66
 
        usleep((int)(t*1e6));
 
64
        /* get whole seconds */
 
65
        int s = (int)t;
 
66
 
 
67
        if(s >= 1) {
 
68
                sleep(s);
 
69
 
 
70
                /* adjust parameter to remove whole seconds */
 
71
                t -= s;
 
72
        }
 
73
 
 
74
        /* get microseconds */
 
75
        int us = (int)(t * 1e6);
 
76
        if (us > 0)
 
77
                usleep(us);
67
78
}
68
79
 
69
80
CCL_NAMESPACE_END