Esempio n. 1
0
        /// <summary>
        /// End net profiling block.
        /// </summary>
        /// <param name="bytesTransfered">Specify number of bytes transferred or null to automatically calculate number of bytes from inner blocks.</param>
        /// <param name="customValue">You can put any number here.</param>
        /// <param name="customValueFormat">This is formatting string how the number will be written on screen, use something like: 'MyNumber: {0} foos/s'</param>
        public static void End(float?bytesTransfered = null, float customValue = 0, string customValueFormat = "", string byteFormat = "{0} B", string callFormat = null, [CallerMemberName] string member = "", [CallerLineNumber] int line = 0, [CallerFilePath] string file = "")
        {
            float val   = m_stack.Pop();
            float bytes = bytesTransfered ?? val;

            m_profiler.EndBlock(member, line, file, bytes.ToTime(), customValue, byteFormat, customValueFormat, callFormat);
            if (m_stack.Count > 0)
            {
                m_stack.Push(m_stack.Pop() + bytes);
            }
        }