本文整理汇总了C++中getSeconds函数的典型用法代码示例。如果您正苦于以下问题:C++ getSeconds函数的具体用法?C++ getSeconds怎么用?C++ getSeconds使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getSeconds函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: renderer
lcRenderer::RenderJob::RenderJob (Ref<lcRenderer> renderer, const Ref<Camera>& camera, const Ref<BackendScene>& scene,
const Ref<ToneMapper>& toneMapper, Ref<SwapChain > swapchain, int accumulate, int iteration)
: renderer(renderer), camera(camera), scene(scene), toneMapper(toneMapper), swapchain(swapchain),
accumulate(accumulate), iteration(iteration), tileID(0), atomicNumRays(0)
{
numTilesX = ((int)swapchain->getWidth() +TILE_SIZE-1)/TILE_SIZE;
numTilesY = ((int)swapchain->getHeight()+TILE_SIZE-1)/TILE_SIZE;
rcpWidth = rcp(float(swapchain->getWidth()));
rcpHeight = rcp(float(swapchain->getHeight()));
this->framebuffer = swapchain->buffer();
renderer->samplers->reset();
renderer->integrator->requestSamples(renderer->samplers, scene);
renderer->samplers->init(iteration,renderer->filter);
double tt = getSeconds();
MTLightcutter(this->scene->lcLighttree, this->scene, this->camera).Lightcut(this->swapchain, renderer->samplers->samplesPerPixel);
for (size_t i = 0 ; i < swapchain->getWidth(); ++i)
{
for (size_t j = 0 ; j < swapchain->getHeight(); ++j)
{
// HACK to get the color of the pixel
Color L = swapchain->update(i, j,Color(zero),0,true);
const Color L1 = toneMapper->eval(L,i,j,swapchain);
framebuffer->set(i, j, L1);
}
}
double dt = getSeconds()-tt;
/*! print fps, render time, and rays per second */
std::ostringstream stream;
stream << "render ";
stream.setf(std::ios::fixed, std::ios::floatfield);
stream.precision(2);
stream << 1.0f/dt << " fps, ";
stream.precision(0);
stream << dt*1000.0f << " ms, ";
stream.precision(3);
stream << atomicNumRays/dt*1E-6 << " mrps";
std::cout << stream.str() << std::endl;
// delete this
delete this;
}
开发者ID:winmad,项目名称:IlluminationCut,代码行数:44,代码来源:lcRenderer.cpp
示例2: getSeconds
char* DS1307::getTime(void)
{
uint8_t seconds = getSeconds();
uint8_t minutes = getMinutes();
hours_t hours = getHours();
snprintf(timeBuf, 10, "%02d:%02d:%02d", hours.hours, minutes, seconds);
return timeBuf;
}
开发者ID:onttoni,项目名称:ds1307,代码行数:10,代码来源:ds1307.cpp
示例3: checkYearsAndMonths
Weeks *Period::toStandardWeeks() {
checkYearsAndMonths("Weeks");
int64_t millis = getMillis(); // assign to a int64_t
millis += ((int64_t) getSeconds()) * DateTimeConstants::MILLIS_PER_SECOND;
millis += ((int64_t) getMinutes()) * DateTimeConstants::MILLIS_PER_MINUTE;
millis += ((int64_t) getHours()) * DateTimeConstants::MILLIS_PER_HOUR;
millis += ((int64_t) getDays()) * DateTimeConstants::MILLIS_PER_DAY;
int64_t weeks = ((int64_t) getWeeks()) + millis / DateTimeConstants::MILLIS_PER_WEEK;
return Weeks::weeks(FieldUtils::safeToInt(weeks));
}
开发者ID:saulpower,项目名称:CodaTime,代码行数:10,代码来源:Period.cpp
示例4: updateCamera
void Renderer::update() {
if(resetAccumulation) {
accumulation = 0;
resetAccumulation = false;
}
if(numPassesMax > 0 && accumulation >= numPassesMax) return;
updateCamera();
double t = getSeconds();
device->rtRenderFrame(renderer, camera, render_scene, tonemapper, frameBuffer, accumulation);
lastRenderTime = getSeconds() - t;
accumulatedTime += lastRenderTime;
device->rtSwapBuffers(frameBuffer);
accumulation++;
}
开发者ID:kikko,项目名称:ofxEmbree,代码行数:19,代码来源:Renderer.cpp
示例5: getSeconds
uint32_t TimeStamp::getMonth() const {
const int32_t seconds = getSeconds();
const int32_t daysSince01011970 = seconds / (60*60*24);
const int32_t yearsSince01011970 = daysSince01011970 / 365;
uint32_t additionalLeapDays = 0;
uint32_t year = 1970;
for(int32_t i = 0; i < yearsSince01011970; i++) {
if (isLeapYear(year)) {
additionalLeapDays++;
}
year++;
}
const int32_t days = daysSince01011970 - yearsSince01011970*365 - additionalLeapDays;
uint32_t month = 1;
if (days < TimeStamp::December) {
month = 12;
}
if (days < TimeStamp::November) {
month = 11;
}
if (days < TimeStamp::October) {
month = 10;
}
if (days < TimeStamp::September) {
month = 9;
}
if (days < TimeStamp::August) {
month = 8;
}
if (days < TimeStamp::July) {
month = 7;
}
if (days < TimeStamp::June) {
month = 6;
}
if (days < TimeStamp::May) {
month = 5;
}
if (days < TimeStamp::April) {
month = 4;
}
if (days < TimeStamp::March) {
month = 3;
}
if (days < TimeStamp::February) {
month = 2;
}
if (days < TimeStamp::January) {
month = 1;
}
return month;
}
开发者ID:Jessie-SEM,项目名称:MiniatureSmartVehicle,代码行数:55,代码来源:TimeStamp.cpp
示例6: copyAttr
int RootOperationData::copyAttr(const std::string& name, Element & attr) const
{
if (name == SERIALNO_ATTR) { attr = getSerialno(); return 0; }
if (name == REFNO_ATTR) { attr = getRefno(); return 0; }
if (name == FROM_ATTR) { attr = getFrom(); return 0; }
if (name == TO_ATTR) { attr = getTo(); return 0; }
if (name == SECONDS_ATTR) { attr = getSeconds(); return 0; }
if (name == FUTURE_SECONDS_ATTR) { attr = getFutureSeconds(); return 0; }
if (name == ARGS_ATTR) { attr = getArgsAsList(); return 0; }
return RootData::copyAttr(name, attr);
}
开发者ID:bregma,项目名称:atlas-cpp,代码行数:11,代码来源:RootOperation.cpp
示例7: consoleService
void consoleService() {
char ch ;
ch = readKey();
if ( ch < 1 ) {
ch = readServer();
if (ch < 1) return;
}
if ( controlMode(ch) ) { p(" -> %02d:%02d:%02d ", getHours(), getMinutes(), getSeconds() ); }
}
开发者ID:NedFreed,项目名称:master_clock,代码行数:11,代码来源:console.cpp
示例8: renderToFile
void renderToFile(const FileName& fileName)
{
resize(g_width,g_height);
if (g_anim_mode) g_camera.anim = true;
do {
double msec = getSeconds();
AffineSpace3fa pixel2world = g_camera.pixel2world(g_width,g_height);
render(0.0f,pixel2world.l.vx,pixel2world.l.vy,pixel2world.l.vz,pixel2world.p);
msec = getSeconds() - msec;
std::cout << "render time " << 1.0/msec << " fps" << std::endl;
} while(g_loop_mode);
void* ptr = map();
Ref<Image> image = new Image4uc(g_width, g_height, (Col4uc*)ptr);
storeImage(image, fileName);
unmap();
cleanup();
}
开发者ID:baxelrod,项目名称:embree,代码行数:20,代码来源:pathtracer.cpp
示例9: operator
bool operator() ()
{
bool passed = true;
printf("%s::%s ... ",TOSTRING(isa),name);
fflush(stdout);
const size_t M = 10;
for (size_t N=10; N<10000000; N*=2.1f)
{
/* sequentially calculate sum of squares */
size_t sum0 = 0;
for (size_t i=0; i<N; i++) {
sum0 += i*i;
}
/* parallel calculation of sum of squares */
double t0 = getSeconds();
for (size_t m=0; m<M; m++)
{
size_t sum1 = parallel_reduce( size_t(0), size_t(N), size_t(1024), size_t(0), [&](const range<size_t>& r) -> size_t
{
size_t s = 0;
for (size_t i=r.begin(); i<r.end(); i++)
s += i*i;
return s;
},
[](const size_t v0, const size_t v1) {
return v0+v1;
});
passed = sum0 == sum1;
}
double t1 = getSeconds();
printf("%zu/%3.2fM ",N,1E-6*double(N*M)/(t1-t0));
}
/* output if test passed or not */
if (passed) printf("[passed]\n");
else printf("[failed]\n");
return passed;
}
开发者ID:JianpingCAI,项目名称:libigl,代码行数:41,代码来源:parallel_reduce.cpp
示例10:
double BVH4::preBuild(const char* builderName)
{
if (builderName == nullptr)
return inf;
if (State::instance()->verbosity(1))
std::cout << "building BVH4<" << primTy.name << "> using " << builderName << " ..." << std::flush;
double t0 = 0.0;
if (State::instance()->benchmark || State::instance()->verbosity(1)) t0 = getSeconds();
return t0;
}
开发者ID:baxelrod,项目名称:embree,代码行数:12,代码来源:bvh4.cpp
示例11: QString
/* get time in string format
* default format is:
* "hh:mm::ss'ddd",
* where:
* hh - hour,
* mm - minures,
* ss - seconds,
* ddd - miliseconds.
*/
rfc::String rfc::Time::getTimeString() const {
/*
if (isInfinity)
return QString("infinity");
*/
return
String::toString(getHours()) + QString(":")
+ String::toString(getMinutes()) + QString(":")
+ String::toString(getSeconds()) + QString("'")
+ String::toString(getMilliSec());
} /* end of 'Time::getTimeString' function */
开发者ID:kbsx32,项目名称:raftcomp,代码行数:21,代码来源:laptime.cpp
示例12:
double BVHN<N>::preBuild(const std::string& builderName)
{
if (builderName == "")
return inf;
if (device->verbosity(1))
std::cout << "building BVH" << N << "<" << primTy.name << "> using " << builderName << " ..." << std::flush;
double t0 = 0.0;
if (device->benchmark || device->verbosity(1)) t0 = getSeconds();
return t0;
}
开发者ID:ElrosMorlin,项目名称:embree,代码行数:12,代码来源:bvh.cpp
示例13: lock
void InputControl::processEvents(void) {
Lock<MutexSys> lock(inputControlMutex);
if (UNLIKELY(inputControl == NULL)) {
init();
this->dt = inf;
this->time = lastTime = getSeconds();
} else {
this->time = getSeconds();
this->dt = this->time - lastTime;
lastTime = this->time;
}
inputControl = this;
glutMainLoopEvent();
glutWarpPointer(this->w/2, this->h/2);
const int w0 = glutGet(GLUT_WINDOW_WIDTH);
const int h0 = glutGet(GLUT_WINDOW_HEIGHT);
if (w0 != this->w || h0 != this->h) this->isResized = 1;
this->w = w0;
this->h = h0;
previousInput = this;
}
开发者ID:binhpt,项目名称:point-frag,代码行数:21,代码来源:windowing.cpp
示例14: operator
bool operator() ()
{
bool passed = true;
printf("%s::%s ... ",TOSTRING(isa),name);
fflush(stdout);
const size_t M = 10;
for (size_t N=10; N<10000000; N*=2.1f)
{
/* initialize array with random numbers */
uint32_t sum0 = 0;
std::vector<uint32_t> src(N);
for (size_t i=0; i<N; i++) {
sum0 += src[i] = rand();
}
/* calculate parallel prefix sum */
std::vector<uint32_t> dst(N);
memset(dst.data(),0,N*sizeof(uint32_t));
double t0 = getSeconds();
for (size_t i=0; i<M; i++) {
uint32_t sum1 = parallel_prefix_sum(src,dst,N);
passed &= (sum0 == sum1);
}
double t1 = getSeconds();
printf("%zu/%3.2fM ",N,1E-6*double(N*M)/(t1-t0));
/* check if prefix sum is correct */
for (size_t i=0, sum=0; i<N; sum+=src[i++])
passed &= ((uint32_t)sum == dst[i]);
}
/* output if test passed or not */
if (passed) printf("[passed]\n");
else printf("[failed]\n");
return passed;
}
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:40,代码来源:prefix.cpp
示例15: renderBenchmark
void renderBenchmark(const FileName& fileName)
{
resize(g_width,g_height);
AffineSpace3fa pixel2world = g_camera.pixel2world(g_width,g_height);
double dt = 0.0f;
size_t numTotalFrames = g_skipBenchmarkFrames + g_numBenchmarkFrames;
for (size_t i=0; i<numTotalFrames; i++)
{
double t0 = getSeconds();
render(0.0f,pixel2world.l.vx,pixel2world.l.vy,pixel2world.l.vz,pixel2world.p);
double t1 = getSeconds();
std::cout << "frame [" << i << " / " << numTotalFrames << "] ";
std::cout << 1.0/(t1-t0) << "fps ";
if (i < g_skipBenchmarkFrames) std::cout << "(skipped)";
std::cout << std::endl;
if (i >= g_skipBenchmarkFrames) dt += t1-t0;
}
std::cout << "frame [" << g_skipBenchmarkFrames << " - " << numTotalFrames << "] " << std::flush;
std::cout << double(g_numBenchmarkFrames)/dt << "fps " << std::endl;
std::cout << "BENCHMARK_RENDER " << double(g_numBenchmarkFrames)/dt << std::endl;
}
开发者ID:D-POWER,项目名称:embree,代码行数:22,代码来源:tutorial03.cpp
示例16: getTimeStr
// returns str of length 9 (with zero symbol)
const char* getTimeStr(void)
{
static char timeStrBuff[9];
strcpy(timeStrBuff, getTimeStrHoursMinutes());
timeStrBuff[5] = ':';
const uint08 seconds = getSeconds();
timeStrBuff[6] = GET_PROGMEM_DIGIT(seconds / 10);
timeStrBuff[7] = GET_PROGMEM_DIGIT(seconds % 10);
timeStrBuff[8] = '\0';
return timeStrBuff;
}
开发者ID:dek-an,项目名称:Micro,代码行数:14,代码来源:clock.c
示例17: getSeconds
Time Time::operator+(const Time& time) const
{
unsigned int seconds = getSeconds() + time.getSeconds();
unsigned int uSeconds = getUSeconds() + time.getUSeconds();
if (uSeconds > uSecondsPerSecond)
{
++seconds;
uSeconds -= uSecondsPerSecond;
}
return Time(seconds, uSeconds);
}
开发者ID:bcrusco,项目名称:bammm,代码行数:13,代码来源:Time.cpp
示例18: operator
bool operator() ()
{
bool passed = true;
printf("%s::%s ... ",TOSTRING(isa),name);
fflush(stdout);
const size_t M = 10;
for (size_t N=10; N<10000000; N*=2.1f)
{
std::vector<Key> src(N); memset(src.data(),0,N*sizeof(Key));
std::vector<Key> tmp(N); memset(tmp.data(),0,N*sizeof(Key));
for (size_t i=0; i<N; i++) src[i] = uint64_t(rand())*uint64_t(rand());
/* calculate checksum */
Key sum0 = 0; for (size_t i=0; i<N; i++) sum0 += src[i];
/* sort numbers */
double t0 = getSeconds();
for (size_t i=0; i<M; i++) {
radix_sort<Key>(src.data(),tmp.data(),N);
}
double t1 = getSeconds();
printf("%zu/%3.2fM ",N,1E-6*double(N*M)/(t1-t0));
/* calculate checksum */
Key sum1 = 0; for (size_t i=0; i<N; i++) sum1 += src[i];
if (sum0 != sum1) passed = false;
/* check if numbers are sorted */
for (size_t i=1; i<N; i++)
passed &= src[i-1] <= src[i];
}
/* output if test passed or not */
if (passed) printf("[passed]\n");
else printf("[failed]\n");
return passed;
}
开发者ID:Acidburn0zzz,项目名称:OSPRay,代码行数:39,代码来源:sort.cpp
示例19: displayFunc
void displayFunc(void)
{
AffineSpace3fa pixel2world = g_camera.pixel2world(g_width,g_height);
/* render image using ISPC */
double t0 = getSeconds();
render(g_time0-t0,
pixel2world.l.vx,
-pixel2world.l.vy,
pixel2world.l.vz+g_height*pixel2world.l.vy,
pixel2world.p);
double dt0 = getSeconds()-t0;
if (g_display)
{
/* draw pixels to screen */
int* pixels = map();
//glRasterPos2i(-1, 1);
//glPixelZoom(1.0f, -1.0f);
glDrawPixels(g_width,g_height,GL_RGBA,GL_UNSIGNED_BYTE,pixels);
glutSwapBuffers();
unmap();
}
double dt1 = getSeconds()-t0;
/* print frame rate */
std::ostringstream stream;
stream.setf(std::ios::fixed, std::ios::floatfield);
stream.precision(2);
stream << "render: ";
stream << 1.0f/dt0 << " fps, ";
stream << dt0*1000.0f << " ms, ";
stream << "display: ";
stream << 1.0f/dt1 << " fps, ";
stream << dt1*1000.0f << " ms, ";
stream << g_width << "x" << g_height << " pixels";
std::cout << stream.str() << std::endl;
}
开发者ID:JianpingCAI,项目名称:libigl,代码行数:39,代码来源:glutdisplay.cpp
示例20: rtcBuildAccel
void rtcBuildAccel(RTCGeometry* geom, const char* builderTy)
{
double t0 = getSeconds();
TaskScheduler::EventSync event;
geom->build(&event,builderTy);
event.sync();
double dt = getSeconds()-t0;
/* output statistics */
if (g_verbose > 0) {
std::ostringstream stream;
size_t numTriangles = geom->size();
stream.setf(std::ios::fixed, std::ios::floatfield);
stream.precision(0);
stream << "triangles = " << numTriangles << std::endl;
stream << "build time = " << dt*1000.0f << " ms" << std::endl;
stream.precision(3);
stream << "build performance = " << double(numTriangles)/dt*1E-6 << " Mtris/s" << std::endl;
stream << "memory pool = " << double(Alloc::global.size())*1E-6 << " MB" << std::endl;
std::cout << stream.str();
geom->accel->print();
}
}
开发者ID:mbdriscoll,项目名称:embree,代码行数:23,代码来源:embree.cpp
注:本文中的getSeconds函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论