当前位置: 首页>>代码示例>>C++>>正文


C++ wxGetLocalTimeMillis函数代码示例

本文整理汇总了C++中wxGetLocalTimeMillis函数的典型用法代码示例。如果您正苦于以下问题:C++ wxGetLocalTimeMillis函数的具体用法?C++ wxGetLocalTimeMillis怎么用?C++ wxGetLocalTimeMillis使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wxGetLocalTimeMillis函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: locker

wxSemaError wxSemaphoreInternal::WaitTimeout(unsigned long milliseconds)
{
    wxMutexLocker locker(m_mutex);

    wxLongLong startTime = wxGetLocalTimeMillis();

    while ( m_count == 0 )
    {
        wxLongLong elapsed = wxGetLocalTimeMillis() - startTime;
        long remainingTime = (long)milliseconds - (long)elapsed.GetLo();
        if ( remainingTime <= 0 )
        {
            // timeout
            return wxSEMA_TIMEOUT;
        }

        switch ( m_cond.WaitTimeout(remainingTime) )
        {
            case wxCOND_TIMEOUT:
                return wxSEMA_TIMEOUT;

            default:
                return wxSEMA_MISC_ERROR;

            case wxCOND_NO_ERROR:
                ;
        }
    }

    m_count--;

    return wxSEMA_NO_ERROR;
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:33,代码来源:threadpsx.cpp

示例2: Entry

	/*****************************************************
	**
	**   AtlasLogicCountWorker   ---   Entry
	**
	******************************************************/
	ExitCode Entry()
	{
		while ( sharedSection->doExit == false )
		{
			Sleep( COUNT_THREAD_SLEEP_MILLISEC );
			if ( sharedSection->countHasOrder )
			{
#ifdef DEB_ATLAS_LOGIC
				printf( "AtlasLogicCountWorker: location count started, filter \"%s\", country \"%s\", mode %d\n",
					str2char( logic->filter ), str2char( logic->country ), logic->mode );
				wxLongLong starttime = wxGetLocalTimeMillis();
#endif
				sharedSection->countHasOrder = false;
				int c = dao->getMatchCount( logic->filter, logic->country, logic->mode );

				if ( sharedSection->countHasOrder )
				{
					// new order arrived, filter conditions have changed meanwhile: do not write results
					printf( "WARN: AtlasLogicCountWorker has new order before finishing request\n" );
				}
				else
				{
					mutex.Lock();
					sharedSection->countHasNews = true;
					sharedSection->count = c;
					mutex.Unlock();
#ifdef DEB_ATLAS_LOGIC
					wxLongLong duration = wxGetLocalTimeMillis() - starttime;
					printf( "AtlasLogicCountWorker: Location count finished, %d results in %ld millisec\n", c, duration.ToLong() );
#endif
				}
			}
		}
		return 0;
	}
开发者ID:akshaykinhikar,项目名称:maitreya7,代码行数:40,代码来源:AtlasLogic.cpp

示例3: wxCOMPILE_TIME_ASSERT

int
wxEpollDispatcher::DoPoll(epoll_event *events, int numEvents, int timeout) const
{
    // the code below relies on TIMEOUT_INFINITE being -1 so that we can pass
    // timeout value directly to epoll_wait() which interprets -1 as meaning to
    // wait forever and would need to be changed if the value of
    // TIMEOUT_INFINITE ever changes
    wxCOMPILE_TIME_ASSERT( TIMEOUT_INFINITE == -1, UpdateThisCode );

    wxMilliClock_t timeEnd;
    if ( timeout > 0 )
        timeEnd = wxGetLocalTimeMillis();

    int rc;
    for ( ;; )
    {
        rc = epoll_wait(m_epollDescriptor, events, numEvents, timeout);
        if ( rc != -1 || errno != EINTR )
            break;

        // we got interrupted, update the timeout and restart
        if ( timeout > 0 )
        {
            timeout = wxMilliClockToLong(timeEnd - wxGetLocalTimeMillis());
            if ( timeout < 0 )
                return 0;
        }
    }

    return rc;
}
开发者ID:Zombiebest,项目名称:Dolphin,代码行数:31,代码来源:epolldispatcher.cpp

示例4: ProfileFindInFilesCodeMode

void ProfileFindInFilesCodeMode() {
    printf("*******\n");
    wxLongLong time = wxGetLocalTimeMillis();
    t4p::DirectorySearchClass directorySearch;
    t4p::SourceClass src;
    src.RootDirectory.AssignDir(DirName);
    src.SetIncludeWildcards(wxT("*.php"));
    std::vector<t4p::SourceClass> sources;
    sources.push_back(src);
    if (directorySearch.Init(sources)) {
        t4p::FindInFilesClass findInFiles;
        findInFiles.Expression = UNICODE_STRING_SIMPLE("class Db");
        findInFiles.Mode = t4p::FinderClass::EXACT;
        if (findInFiles.Prepare()) {
            while (directorySearch.More()) {
                directorySearch.Walk(findInFiles);
            }
            std::vector<wxString> matchedFiles = directorySearch.GetMatchedFiles();
            for (size_t i = 0; i < matchedFiles.size(); ++i) {
                printf("Found at least one match in file %s.\n", (const char*)matchedFiles[i].ToUTF8());
            }
            time = wxGetLocalTimeMillis() - time;
            printf("time for findInFiles Code Mode:%ld ms\n", time.ToLong());
        } else {
            puts("Invalid expression: class Db\n");
        }
    } else {
        printf("Could not open Directory: %s\n", (const char*)DirName.ToAscii());
    }
}
开发者ID:adjustive,项目名称:triumph4php,代码行数:30,代码来源:find_in_files_profiler.cpp

示例5: ProfileFindInFilesExactMode

void ProfileFindInFilesExactMode() {
    printf("*******\n");
    wxLongLong time = wxGetLocalTimeMillis();
    t4p::DirectorySearchClass directorySearch;
    if (directorySearch.Init(DirName)) {
        t4p::FindInFilesClass findInFiles;
        findInFiles.Expression = UNICODE_STRING_SIMPLE("class Db");
        findInFiles.Mode = t4p::FinderClass::EXACT;
        if (findInFiles.Prepare()) {
            while (directorySearch.More()) {
                directorySearch.Walk(findInFiles);
            }
            std::vector<wxString> matchedFiles = directorySearch.GetMatchedFiles();
            for (size_t i = 0; i < matchedFiles.size(); ++i) {
                printf("Found at least one match in file %s.\n", (const char*)matchedFiles[i].ToUTF8());
            }
            time = wxGetLocalTimeMillis() - time;
            printf("time for findInFiles Exact Mode:%ld ms \n", time.ToLong());
        } else {
            puts("Invalid expression: class Db\n");
        }
    } else {
        printf("Could not open Directory: %s\n", (const char*)DirName.ToAscii());
    }
}
开发者ID:adjustive,项目名称:triumph4php,代码行数:25,代码来源:find_in_files_profiler.cpp

示例6: wxGetLocalTimeMillis

/*****************************************************
**
**   Painter   ---   drawMString
**
******************************************************/
void Painter::drawMString( const MRect &r, MString &f, const int& align )
{
#ifdef SHOW_STOP_WATCH
	static wxLongLong totaltime = 0;
	const wxLongLong starttime = wxGetLocalTimeMillis();
#endif

	static int count = 0;
	SheetFormatter sfmt;
	wxString s;

	if ( f.formattedLines.size() == 0 )
	{
		if ( ! f.isEmpty() && f.size.real() == 0 )
		{
			s = sfmt.fragment2PlainText( f );
			//printf( "Painter::drawMString - old size %f %f\n", f.size.real(), f.size.imag());
			f.size = getTextExtent( f );
			printf( "Painter::drawMString - size not set #%d contents was %s, size now %f %f\n", count++, str2char( s ), f.size.real(), f.size.imag());
		}
		drawSingleMStringLine( r, f, align );
		//return;
	}
	else
	{
		double y0 = r.y;
		if ( align & Align::Top )
		{
			// nothing
		}
		else if ( align & Align::Bottom )
		{
			y0 = y0 + r.height - f.size.imag();
		}
		else // default: align & align::VCenter
		{
			y0 += .5 * ( r.height - f.size.imag());
		}

		MRect rect( r.x, y0, r.width, r.height );

		int line = 0;
		for( list<MString>::iterator iter = f.formattedLines.begin(); iter != f.formattedLines.end(); iter++ )
		{
			line++;
			rect.height = iter->size.imag();
			//printf( "  --->>> Line %d width %f h %f\n", line, iter->size.real(), iter->size.imag() );
			drawSingleMStringLine( rect, *iter, align );
			rect.y += rect.height;
		}
	}
#ifdef SHOW_STOP_WATCH
	const wxLongLong duration = wxGetLocalTimeMillis() - starttime;
	totaltime += duration;
	wxLogMessage( wxString::Format( wxT( "Painter::drawTextFormatted in %ld msec, total %ld" ), duration.ToLong(), totaltime.ToLong() ));
#endif

}
开发者ID:martin-pe,项目名称:maitreya8,代码行数:63,代码来源:Painter.cpp

示例7: SendEvent

void GOrgueMidiRecorder::PreconfigureMapping(const wxString& element, bool isNRPN, const wxString& reference)
{
	unsigned id = m_Map.GetElementByString(element);
	unsigned ref = m_Map.GetElementByString(reference);
	for(unsigned i = 0; i < m_Preconfig.size(); i++)
		if (m_Preconfig[i].elementID == ref)
		{
			GOrgueMidiEvent e1;
			e1.SetTime(wxGetLocalTimeMillis());
			e1.SetMidiType(MIDI_SYSEX_GO_SETUP);
			e1.SetKey(id);
			e1.SetChannel(m_Preconfig[i].channel);
			e1.SetValue(m_Preconfig[i].key);
			SendEvent(e1);

			midi_map m = m_Preconfig[i];
			m.elementID = ref;
			if (ref >= m_Mappings.size())
				m_Mappings.resize(ref + 1);
			m_Mappings[ref] = m;
			return;
		}

	midi_map m;
	if (isNRPN)
	{
		if (m_NextNRPN >= 1 << 18)
			return;
		m.elementID = ref;
		m.channel = 1 + m_NextNRPN / (1 << 14);
		m.key = m_NextNRPN % (1 << 14);
		m_NextNRPN++;
	}
	else
	{
		if (m_NextChannel > 16)
			return;
		m.elementID = ref;
		m.channel = m_NextChannel;
		m.key = 0;
		m_NextChannel++;
	}
	m_Preconfig.push_back(m);

	GOrgueMidiEvent e1;
	e1.SetTime(wxGetLocalTimeMillis());
	e1.SetMidiType(MIDI_SYSEX_GO_SETUP);
	e1.SetKey(id);
	e1.SetChannel(m.channel);
	e1.SetValue(m.key);
	SendEvent(e1);

	if (ref >= m_Mappings.size())
		m_Mappings.resize(ref + 1);
	m_Mappings[ref] = m;
}
开发者ID:e9925248,项目名称:grandorgue,代码行数:56,代码来源:GOrgueMidiRecorder.cpp

示例8: wxGetLocalTimeMillis

void Export_DLG::Step(const wxString& fname)
{
	++pos;

	if (next_update_tick < wxGetLocalTimeMillis().GetLo())
	{
		m_gauge1->SetValue(pos);
		m_textCtrl1->SetLabel(fname);
		next_update_tick = wxGetLocalTimeMillis().GetLo()+100;

		wxGetApp().Yield();
	}
}
开发者ID:McBen,项目名称:FDB_Extractor2,代码行数:13,代码来源:Export_DLG.cpp

示例9: printf

/*****************************************************
**
**   AtlasImporter   ---   Destructor
**
******************************************************/
AtlasImporter::~AtlasImporter()
{
	sharedSection->threadOrder = THREADORDER_EXIT;
	if ( importWorker->IsRunning())
	{
		printf( "AtlasImportDialog destructor waiting for import worker to join ...\n" );
		wxLongLong starttime = wxGetLocalTimeMillis();
		importWorker->Wait();
		wxLongLong duration = wxGetLocalTimeMillis() - starttime;
		printf( "Import worker stopped in %ld milllisec\n", duration.ToLong());
	}
	delete importWorker;

	delete sharedSection;
}
开发者ID:akshaykinhikar,项目名称:maitreya7,代码行数:20,代码来源:AtlasImporter.cpp

示例10: Tool

 FlyTool::FlyTool(View::DocumentViewHolder& documentViewHolder, InputController& inputController) :
 Tool(documentViewHolder, inputController, false) {
     for (MoveKey::Type i = 0; i < 4; i++)
         m_moveKeys[i] = 0;
     m_lastUpdateTime = wxGetLocalTimeMillis();
     Start(1000 / 60);
 }
开发者ID:Scampie,项目名称:TrenchBroom,代码行数:7,代码来源:FlyTool.cpp

示例11: DeleteAllItems

void ThreadList::updateThreads(const ProcessInfo* processInfo, SymbolInfo *symInfo)
{
	this->selected_threads.clear();
	DeleteAllItems();
	this->threads.clear();
	ok_button->Enable(false);
	all_button->Enable(false);

	if(processInfo != NULL)
	{
		this->process_handle = processInfo->getProcessHandle();
		this->syminfo = symInfo;

		this->threads = processInfo->threads;

		int numDisplayedThreads = getNumDisplayedThreads();
		for(int i=0; i<numDisplayedThreads; ++i)
		{
			long tmp = this->InsertItem(i, "", -1);
			SetItemData(tmp, i);
		}

		all_button->Enable(this->threads.size() != 0);

		lastTime = wxGetLocalTimeMillis();
		updateTimes();
		updateSorting();
		fillList();
	}
}
开发者ID:VerySleepy,项目名称:verysleepy,代码行数:30,代码来源:threadlist.cpp

示例12: WXUNUSED

void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
{
    m_pendingRefresh = false;
    m_lastRefresh = wxGetLocalTimeMillis();

    if( !m_drawing )
    {
        m_drawing = true;

        m_view->UpdateItems();
        m_gal->BeginDrawing();
        m_gal->ClearScreen( m_painter->GetSettings()->GetBackgroundColor() );

        if( m_view->IsDirty() )
        {
            m_view->ClearTargets();

            // Grid has to be redrawn only when the NONCACHED target is redrawn
            if( m_view->IsTargetDirty( KIGFX::TARGET_NONCACHED ) )
                m_gal->DrawGrid();

            m_view->Redraw();
        }

        m_gal->DrawCursor( m_viewControls->GetCursorPosition() );
        m_gal->EndDrawing();

        m_drawing = false;
    }
}
开发者ID:johnbeard,项目名称:kicad-source-mirror,代码行数:30,代码来源:draw_panel_gal.cpp

示例13: wxSortedListCtrl

ThreadList::ThreadList(wxWindow *parent, const wxPoint& pos,
						 const wxSize& size, wxButton *_ok_button, wxButton *_all_button)
						 :	wxSortedListCtrl(parent, THREADS_LIST, pos, size, wxLC_REPORT),
						 timer(this, THREADS_LIST_TIMER),
						 ok_button(_ok_button), all_button(_all_button)
{
	InitSort();

	wxListItem itemCol;
	itemCol.m_mask = wxLIST_MASK_TEXT/* | wxLIST_MASK_IMAGE*/;
	itemCol.m_text = _T("Thread");
	itemCol.m_image = -1;
	InsertColumn(COL_ID, itemCol);
	itemCol.m_text = _T("Location");
	InsertColumn(COL_LOCATION, itemCol);
	itemCol.m_text = _T("Thread Usage");
	InsertColumn(COL_CPUUSAGE, itemCol);

	SetColumnWidth(COL_ID, 50);
	SetColumnWidth(COL_LOCATION, 200);
	SetColumnWidth(COL_CPUUSAGE, 120);

	sort_column = COL_CPUUSAGE;
	sort_dir = SORT_DOWN;
	SetSortImage(sort_column, sort_dir); 

	process_handle = NULL;
	syminfo = NULL;

	lastTime = wxGetLocalTimeMillis();
	updateThreads(NULL, NULL);
	timer.Start(UPDATE_DELAY);
}
开发者ID:mhoffesommer,项目名称:Very-Sleepy,代码行数:33,代码来源:threadlist.cpp

示例14: wxGetLocalTimeMillis

wxCondError wxConditionInternal::WaitTimeout(unsigned long milliseconds)
{
    wxLongLong curtime = wxGetLocalTimeMillis();
    curtime += milliseconds;
    wxLongLong temp = curtime / 1000;
    int sec = temp.GetLo();
    temp *= 1000;
    temp = curtime - temp;
    int millis = temp.GetLo();

    timespec tspec;

    tspec.tv_sec = sec;
    tspec.tv_nsec = millis * 1000L * 1000L;

    int err = pthread_cond_timedwait( &m_cond, GetPMutex(), &tspec );
    switch ( err )
    {
        case ETIMEDOUT:
            return wxCOND_TIMEOUT;

        case 0:
            return wxCOND_NO_ERROR;

        default:
            wxLogApiError(_T("pthread_cond_timedwait()"), err);
    }

    return wxCOND_MISC_ERROR;
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:30,代码来源:threadpsx.cpp

示例15: wxGetLocalTimeMillis

	void VolumeCreationProgressWizardPage::SetProgressState (bool volumeCreatorRunning)
	{
		if (volumeCreatorRunning)
			StartTime = wxGetLocalTimeMillis();

		VolumeCreatorRunning = volumeCreatorRunning;
	}
开发者ID:CSRedRat,项目名称:CipherShed,代码行数:7,代码来源:VolumeCreationProgressWizardPage.cpp


注:本文中的wxGetLocalTimeMillis函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。