本文整理汇总了C++中currentTimeMS函数的典型用法代码示例。如果您正苦于以下问题:C++ currentTimeMS函数的具体用法?C++ currentTimeMS怎么用?C++ currentTimeMS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了currentTimeMS函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: defaultValueForStepUp
Decimal TimeInputType::defaultValueForStepUp() const {
DateComponents date;
date.setMillisecondsSinceMidnight(convertToLocalTime(currentTimeMS()));
double milliseconds = date.millisecondsSinceEpoch();
DCHECK(std::isfinite(milliseconds));
return Decimal::fromDouble(milliseconds);
}
开发者ID:mirror,项目名称:chromium,代码行数:7,代码来源:TimeInputType.cpp
示例2: _logUsageLocked
static void _logUsageLocked() {
double now = currentTimeMS();
if (now - s_lastLogged > 5) {
s_lastLogged = now;
ALOGV("Total memory usage: %d kb", s_totalAllocations / 1024);
}
}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:7,代码来源:LinearAllocator.cpp
示例3: generateMHTMLHeader
void MHTMLArchive::generateMHTMLHeader(
const String& boundary, const String& title, const String& mimeType,
SharedBuffer& outputBuffer)
{
DateComponents now;
now.setMillisecondsSinceEpochForDateTime(currentTimeMS());
// TODO(lukasza): Passing individual date/time components seems fragile.
String dateString = makeRFC2822DateString(
now.weekDay(), now.monthDay(), now.month(), now.fullYear(),
now.hour(), now.minute(), now.second(), 0);
StringBuilder stringBuilder;
stringBuilder.appendLiteral("From: <Saved by Blink>\r\n");
stringBuilder.appendLiteral("Subject: ");
// We replace non ASCII characters with '?' characters to match IE's behavior.
stringBuilder.append(replaceNonPrintableCharacters(title));
stringBuilder.appendLiteral("\r\nDate: ");
stringBuilder.append(dateString);
stringBuilder.appendLiteral("\r\nMIME-Version: 1.0\r\n");
stringBuilder.appendLiteral("Content-Type: multipart/related;\r\n");
stringBuilder.appendLiteral("\ttype=\"");
stringBuilder.append(mimeType);
stringBuilder.appendLiteral("\";\r\n");
stringBuilder.appendLiteral("\tboundary=\"");
stringBuilder.append(boundary);
stringBuilder.appendLiteral("\"\r\n\r\n");
// We use utf8() below instead of ascii() as ascii() replaces CRLFs with ??
// (we still only have put ASCII characters in it).
ASSERT(stringBuilder.toString().containsOnlyASCII());
CString asciiString = stringBuilder.toString().utf8();
outputBuffer.append(asciiString.data(), asciiString.length());
}
开发者ID:shaoboyan,项目名称:chromium-crosswalk,代码行数:34,代码来源:MHTMLArchive.cpp
示例4: callDate
// ECMA 15.9.2
static EncodedJSValue JSC_HOST_CALL callDate(ExecState* exec)
{
VM& vm = exec->vm();
GregorianDateTime ts;
msToGregorianDateTime(vm, currentTimeMS(), false, ts);
return JSValue::encode(jsNontrivialString(&vm, formatDateTime(ts, DateTimeFormatDateAndTime, false)));
}
开发者ID:CannedFish,项目名称:webkitgtk,代码行数:8,代码来源:DateConstructor.cpp
示例5: completeAbort
void FileWriter::didWrite(long long bytes, bool complete)
{
if (m_operationInProgress == OperationAbort) {
completeAbort();
return;
}
ASSERT(m_readyState == WRITING);
ASSERT(m_truncateLength == -1);
ASSERT(m_operationInProgress == OperationWrite);
ASSERT(!m_bytesToWrite || bytes + m_bytesWritten > 0);
ASSERT(bytes + m_bytesWritten <= m_bytesToWrite);
m_bytesWritten += bytes;
ASSERT((m_bytesWritten == m_bytesToWrite) || !complete);
setPosition(position() + bytes);
if (position() > length())
setLength(position());
if (complete) {
m_blobBeingWritten.clear();
m_operationInProgress = OperationNone;
}
int numAborts = m_numAborts;
// We could get an abort in the handler for this event. If we do, it's
// already handled the cleanup and signalCompletion call.
double now = currentTimeMS();
if (complete || !m_lastProgressNotificationTimeMS || (now - m_lastProgressNotificationTimeMS > progressNotificationIntervalMS)) {
m_lastProgressNotificationTimeMS = now;
fireEvent(EventTypeNames::progress);
}
if (complete) {
if (numAborts == m_numAborts)
signalCompletion(FileError::OK);
}
}
开发者ID:dstockwell,项目名称:blink,代码行数:35,代码来源:FileWriter.cpp
示例6: ASSERT
void PromiseTracker::didCreatePromise(const ScriptObject& promise)
{
ASSERT(isEnabled());
double timestamp = currentTimeMS();
m_promiseDataMap.set(promise, adoptRef(new PromiseData(promise, ScriptObject(), ScriptValue(), V8PromiseCustom::Pending, timestamp)));
}
开发者ID:coinpayee,项目名称:blink,代码行数:7,代码来源:PromiseTracker.cpp
示例7:
void RemoteFontFaceSource::FontLoadHistograms::recordFallbackTime(const FontResource* font)
{
if (m_fallbackPaintTime <= 0)
return;
int duration = static_cast<int>(currentTimeMS() - m_fallbackPaintTime);
blink::Platform::current()->histogramCustomCounts("WebFont.BlankTextShownTime", duration, 0, 10000, 50);
m_fallbackPaintTime = -1;
}
开发者ID:coinpayee,项目名称:blink,代码行数:8,代码来源:RemoteFontFaceSource.cpp
示例8: currentTimeMS
void LayoutAnalyzer::reset()
{
m_startMs = currentTimeMS();
m_depth = 0;
for (size_t i = 0; i < NumCounters; ++i) {
m_counters[i] = 0;
}
}
开发者ID:smishenk,项目名称:chromium-crosswalk,代码行数:8,代码来源:LayoutAnalyzer.cpp
示例9: currentTimeMS
long Timer::stop() {
m_stopMS = currentTimeMS();
if (!m_isStarted) {
// error("Timer is not started");
m_startMS = m_stopMS;
}
m_isStarted = false;
return elapsed();
}
开发者ID:MoonighT,项目名称:CS106B,代码行数:9,代码来源:timer.cpp
示例10: currentTimeMS
void TilesProfiler::start()
{
m_enabled = true;
m_goodTiles = 0;
m_badTiles = 0;
m_records.clear();
m_time = currentTimeMS();
XLOG("initializing tileprofiling");
}
开发者ID:ACSOP,项目名称:android_external_webkit,代码行数:9,代码来源:TilesProfiler.cpp
示例11: callDate
// ECMA 15.9.2
static EncodedJSValue JSC_HOST_CALL callDate(ExecState* exec)
{
GregorianDateTime ts;
msToGregorianDateTime(exec, currentTimeMS(), false, ts);
DateConversionBuffer date;
DateConversionBuffer time;
formatDate(ts, date);
formatTime(ts, time);
return JSValue::encode(jsMakeNontrivialString(exec, date, " ", time));
}
开发者ID:kseo,项目名称:webkit,代码行数:11,代码来源:DateConstructor.cpp
示例12: currentTimeMS
void Plan::compileInThread(LongLivedState& longLivedState, ThreadData* threadData)
{
this->threadData = threadData;
double before = 0;
if (reportCompileTimes())
before = currentTimeMS();
SamplingRegion samplingRegion("DFG Compilation (Plan)");
CompilationScope compilationScope;
if (logCompilationChanges(mode))
dataLog("DFG(Plan) compiling ", *codeBlock, " with ", mode, ", number of instructions = ", codeBlock->instructionCount(), "\n");
CompilationPath path = compileInThreadImpl(longLivedState);
RELEASE_ASSERT(finalizer);
if (reportCompileTimes()) {
const char* pathName;
switch (path) {
case FailPath:
pathName = "N/A (fail)";
break;
case DFGPath:
pathName = "DFG";
break;
case FTLPath:
pathName = "FTL";
break;
default:
RELEASE_ASSERT_NOT_REACHED();
pathName = "";
break;
}
double now = currentTimeMS();
dataLog("Optimized ", *codeBlock, " using ", mode, " with ", pathName, " into ", finalizer->codeSize(), " bytes in ", now - before, " ms");
if (path == FTLPath)
dataLog(" (DFG: ", beforeFTL - before, ", LLVM: ", now - beforeFTL, ")");
dataLog(".\n");
}
}
开发者ID:PTaylour,项目名称:webkit,代码行数:42,代码来源:DFGPlan.cpp
示例13: dataLog
void TypeProfilerLog::processLogEntries(const String& reason)
{
double before = 0;
if (verbose) {
dataLog("Process caller:'", reason, "'");
before = currentTimeMS();
}
LogEntry* entry = m_logStartPtr;
HashMap<Structure*, RefPtr<StructureShape>> seenShapes;
while (entry != m_currentLogEntryPtr) {
StructureID id = entry->structureID;
RefPtr<StructureShape> shape;
JSValue value = entry->value;
Structure* structure = nullptr;
if (id) {
structure = Heap::heap(value.asCell())->structureIDTable().get(id);
auto iter = seenShapes.find(structure);
if (iter == seenShapes.end()) {
shape = structure->toStructureShape(value);
seenShapes.set(structure, shape);
} else
shape = iter->value;
}
RuntimeType type = runtimeTypeForValue(value);
TypeLocation* location = entry->location;
location->m_lastSeenType = type;
if (location->m_globalTypeSet)
location->m_globalTypeSet->addTypeInformation(type, shape, structure);
location->m_instructionTypeSet->addTypeInformation(type, shape, structure);
entry++;
}
m_currentLogEntryPtr = m_logStartPtr;
if (verbose) {
double after = currentTimeMS();
dataLogF(" Processing the log took: '%f' ms\n", after - before);
}
}
开发者ID:cheekiatng,项目名称:webkit,代码行数:42,代码来源:TypeProfilerLog.cpp
示例14: currentTimeMS
void FileReader::didReceiveData()
{
// Fire the progress event at least every 50ms.
double now = currentTimeMS();
if (!m_lastProgressNotificationTimeMS)
m_lastProgressNotificationTimeMS = now;
else if (now - m_lastProgressNotificationTimeMS > progressNotificationIntervalMS) {
fireEvent(EventTypeNames::progress);
m_lastProgressNotificationTimeMS = now;
}
}
开发者ID:coinpayee,项目名称:blink,代码行数:11,代码来源:FileReader.cpp
示例15: currentTimeMS
void V8File::lastModifiedAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& info)
{
File* file = V8File::toNative(info.Holder());
double lastModified = file->lastModifiedDate();
if (!isValidFileTime(lastModified))
lastModified = currentTimeMS();
// lastModified returns a number, not a Date instance.
// http://dev.w3.org/2006/webapi/FileAPI/#file-attrs
v8SetReturnValue(info, floor(lastModified));
}
开发者ID:coinpayee,项目名称:blink,代码行数:11,代码来源:V8FileCustom.cpp
示例16: currentTimeMS
void PaintTileOperation::endTime() {
if (m_startTimeMS == 0.0) return;
double timeDelta = currentTimeMS() - m_startTimeMS;
m_startTimeMS = 0.0;
#if ENABLE(IMPROVE_TEXTURES_GENERATOR_MULTI_CORE)
TilesManager* tilesManager = TilesManager::instance();
bool supportMultiCoreTextGen = (tilesManager && tilesManager->supportMultiCoreTexturesGen());
XLOGD2("Support multi-thread texture generator = %d >> %f", supportMultiCoreTextGen, timeDelta);
#else
XLOGD2("%f", timeDelta);
#endif
}
开发者ID:besk,项目名称:MT6589_kernel_source,代码行数:12,代码来源:PaintTileOperation.cpp
示例17: currentTimeMS
Decimal TimeInputType::defaultValueForStepUp() const
{
double current = currentTimeMS();
int offset = calculateLocalTimeOffset(current).offset / msPerMinute;
current += offset * msPerMinute;
DateComponents date;
date.setMillisecondsSinceMidnight(current);
double milliseconds = date.millisecondsSinceEpoch();
ASSERT(std::isfinite(milliseconds));
return Decimal::fromDouble(milliseconds);
}
开发者ID:kodybrown,项目名称:webkit,代码行数:12,代码来源:TimeInputType.cpp
示例18: currentFullYear
static int currentFullYear()
{
double current = currentTimeMS();
double utcOffset = calculateUTCOffset();
double dstOffset = calculateDSTOffset(current, utcOffset);
int offset = static_cast<int>((utcOffset + dstOffset) / msPerMinute);
current += offset * msPerMinute;
DateComponents date;
date.setMillisecondsSinceEpochForMonth(current);
return date.fullYear();
}
开发者ID:fatman2021,项目名称:webkitgtk,代码行数:12,代码来源:DateTimeFieldElements.cpp
注:本文中的currentTimeMS函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论