public IHttpActionResult PostSlow([FromBody]SlowDto slowDto)
        {
            int result = 0;
            int limit = 1000;

            if (slowDto.LimitNum != 0 && slowDto.LimitNum != null)
            {
                limit = slowDto.LimitNum;
            }

            try
            {
                for (int i = 0; i < limit; i++)
                {
                    SlowMan sm = new SlowMan();
                    result += sm.SlowMethod();
                }
            }
            catch (Exception e)
            {
                return Ok(e.ToString());
            }

            return Ok("post <"+ limit + "> result ok: " + result);
        }
Exemple #2
0
        public IHttpActionResult PostSlow([FromBody] SlowDto slowDto)
        {
            int result = 0;
            int limit  = 1000;

            if (slowDto.LimitNum != 0 && slowDto.LimitNum != null)
            {
                limit = slowDto.LimitNum;
            }

            try
            {
                for (int i = 0; i < limit; i++)
                {
                    SlowMan sm = new SlowMan();
                    result += sm.SlowMethod();
                }
            }
            catch (Exception e)
            {
                return(Ok(e.ToString()));
            }

            return(Ok("post <" + limit + "> result ok: " + result));
        }
Exemple #3
0
        public IHttpActionResult GetSlow()
        {
            int result = 0;

            try
            {
                for (int i = 0; i < 1000; i++)
                {
                    SlowMan sm = new SlowMan();
                    result += sm.SlowMethod();
                }
            }
            catch (Exception e)
            {
                return(Ok(e.ToString()));
            }

            return(Ok("result ok, this is " + System.Configuration.ConfigurationManager.AppSettings["TEST_CONFIG"] + " >> " + result));
        }
        public IHttpActionResult GetSlow()
        {
            int result = 0;

            try
            {
                for (int i = 0; i < 1000; i++)
                {
                    SlowMan sm = new SlowMan();
                    result += sm.SlowMethod();

                }
            }
            catch (Exception e)
            {
                return Ok(e.ToString());
            }

            return Ok("result ok, this is " + System.Configuration.ConfigurationManager.AppSettings["TEST_CONFIG"] + " >> " + result);
        }