forked from enlightenment/efl
ecore,elementary: move startup time accounting in ecore.
This commit is contained in:
parent
25b6a280c0
commit
dd40079185
|
@ -61,6 +61,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern EAPI double _efl_startup_time;
|
||||
|
||||
#include "Ecore_Common.h"
|
||||
#include "Ecore_Eo.h"
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <Efl.h>
|
||||
|
||||
#include "Ecore.h"
|
||||
#include "Efl_Core.h"
|
||||
#include "ecore_private.h"
|
||||
|
||||
#if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_INFO)
|
||||
|
@ -43,6 +44,8 @@
|
|||
static Ecore_Version _version = { VMAJ, VMIN, VMIC, VREV };
|
||||
EAPI Ecore_Version *ecore_version = &_version;
|
||||
|
||||
EAPI double _efl_startup_time = 0;
|
||||
|
||||
#if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_INFO)
|
||||
#define KEEP_MAX(Global, Local) \
|
||||
if (Global < (Local)) \
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
{ \
|
||||
Eina_Value *ret__; \
|
||||
int real__; \
|
||||
_efl_startup_time = ecore_time_unix_get(); \
|
||||
_EFL_APP_VERSION_SET(); \
|
||||
_elm_startup_time = ecore_time_unix_get(); \
|
||||
elm_init(argc, argv); \
|
||||
efl_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL); \
|
||||
ret__ = efl_loop_begin(ecore_main_loop_get()); \
|
||||
|
@ -55,8 +55,8 @@
|
|||
{ \
|
||||
Eina_Value *ret__; \
|
||||
int real__; \
|
||||
_efl_startup_time = ecore_time_unix_get(); \
|
||||
_EFL_APP_VERSION_SET(); \
|
||||
_elm_startup_time = ecore_time_unix_get(); \
|
||||
elm_init(argc, argv); \
|
||||
efl_event_callback_array_add(ecore_main_loop_get(), _efl_main_ex(), NULL); \
|
||||
ret__ = efl_loop_begin(ecore_main_loop_get()); \
|
||||
|
|
|
@ -96,6 +96,7 @@ extern EAPI double _elm_startup_time;
|
|||
#define ELM_MAIN() int main(int argc, char **argv) { int ret__; _elm_startup_time = ecore_time_unix_get(); ret__ = elm_quicklaunch_fallback(argc, argv); elm_shutdown(); return ret__; }
|
||||
#endif
|
||||
|
||||
#include "Efl_Core.h"
|
||||
#include "efl_general.h"
|
||||
|
||||
/**************************************************************************/
|
||||
|
|
|
@ -424,6 +424,14 @@ elm_init(int argc, char **argv)
|
|||
_elm_config->web_backend = "none";
|
||||
_elm_code_parse_setup();
|
||||
|
||||
// For backward compability, EFL startup time and ELM startup time are made
|
||||
// identical. It is fine to do it here as we are finishing initialisation
|
||||
// and the startup time should have been accounted earlier.
|
||||
if (_elm_startup_time >= 0)
|
||||
if (_efl_startup_time <= 0)
|
||||
_efl_startup_time = _elm_startup_time;
|
||||
_elm_startup_time = _efl_startup_time;
|
||||
|
||||
return _elm_init_count;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue