Esempio n. 1
0
        static void DisplayMemoryUsage(MemoryInfo info, MemoryUsage usage)
        {
            Console.WriteLine("---------------");
            Console.WriteLine("  Memory Info");
            Console.WriteLine("---------------");

            Console.WriteLine("Text = {0}B, Data = {1}B, BSS = {2}B, Sum = {3}B",
                              usage.TextSize, usage.DataSize, usage.BssSize,
                              usage.TextSize + usage.DataSize + usage.BssSize);

            int usedFlash = usage.TextSize + usage.DataSize;
            int maxFlash  = info.FlashSize;

            Console.WriteLine("Flash\t{0:0.00}%\t({1}B/{2}B)",
                              (double)usedFlash / maxFlash * 100, usedFlash, maxFlash);

            int usedRam = usage.DataSize + usage.BssSize;
            int maxRam  = info.RamSize;

            Console.WriteLine("RAM  \t{0:0.00}%\t({1}B/{2}B)",
                              (double)usedRam / maxRam * 100, usedRam, maxRam);
        }
Esempio n. 2
0
        static void DisplayMemoryUsage(MemoryInfo info, MemoryUsage usage)
        {
            Console.WriteLine("---------------");
            Console.WriteLine("  Memory Info");
            Console.WriteLine("---------------");

            Console.WriteLine("Text = {0}B, Data = {1}B, BSS = {2}B, Sum = {3}B",
                usage.TextSize, usage.DataSize, usage.BssSize,
                usage.TextSize + usage.DataSize + usage.BssSize);

            int usedFlash = usage.TextSize + usage.DataSize;
            int maxFlash = info.FlashSize;
            Console.WriteLine("Flash\t{0:0.00}%\t({1}B/{2}B)",
                (double)usedFlash / maxFlash * 100, usedFlash, maxFlash);

            int usedRam = usage.DataSize + usage.BssSize;
            int maxRam = info.RamSize;
            Console.WriteLine("RAM  \t{0:0.00}%\t({1}B/{2}B)",
                (double)usedRam / maxRam * 100, usedRam, maxRam);
        }