the time is too long to run short code.

I have a simple code.
send msg to a message queue. and handle the message in another thread.
I my old environment ncs2.4.0.   I looks works well.
// after get msg queue. to data.

switch (data.msgid)
        {
            case RECV:
            case SEND:
               
               
                printk("%lld get msg and prepare.\n",k_uptime_get() );
             
                fre = (uint8_t) data.field2;
                switch(fre){
                    case 0:
                        fre = 2;
                        break;
                    case 1:
                        fre = 20;
                        break;
                    case 2:
                        fre = 200;
                        break;
                    default:
                        (void)fre;
                }
                if(fre == 2){
                    char *info="shut down now.";
                    printk("%s\n", info );
                }
               
                if( STATUS_IDLE == get_sys_status() ){
                    printk("%lld handle.\n",k_uptime_get() );
                    sys_prepare(); 
                    
                }
                else{
                    printk("%lld handle.\n",k_uptime_get() );
                    sys_prepare();
                }
just simple code. 
I my old environment.  the time difference is less than 1ms.
but after some time. my environement damaged. and I set new environment. and copy the same code t0 run 
find the time gap is as much as 15 to 20ms.
I did not modify code .

why such simple code take so long time.
thanks. 
Parents Reply Children
No Data
Related