/// <summary>
        ///   Stop collecting profiling data. This method doesn't save the collected data block to the disk.
        ///   Doesn't throw any errors even if the application is run with profiling disabled.
        /// </summary>
        public static void StopCollectingData()
        {
            var id = Helper.Id;

            switch (Helper.Platform)
            {
            case PlatformId.Linux:
                if (LinuxHelper.IsLibCoreApiAlreadyLoaded())
                {
                    Helper.InvokeCoreApi(() => LibCoreApi.V1_Measure_StopCollecting(id));
                }
                break;

            case PlatformId.MacOsX:
                if (MacOsXHelper.IsLibCoreApiAlreadyLoaded())
                {
                    Helper.InvokeCoreApi(() => LibCoreApi.V1_Measure_StopCollecting(id));
                }
                break;

            case PlatformId.Windows:
                if (WindowsHelper.IsCoreApiDllAlreadyLoaded())
                {
                    Helper.InvokeCoreApi(() => CoreApiDll.V1_Measure_StopCollecting(id));
                }
                break;

            default:
                throw new PlatformNotSupportedException();
            }
        }