Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest Class Reference

Test the download speed of the Internet connection. More...

Inheritance diagram for Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest:
Crosstales.Common.Util.Singleton< SpeedTest >

Public Member Functions

delegate void TestCompleted (string url, long dataSize, double duration, double speed)
 Callback to determine whether the speed test has completed. More...
 
void Test ()
 Checks the Internet download speed with the 'DataSize'-variable. More...
 
void Test (TestSize size)
 Checks the Internet download speed with a given data size. More...
 
void Test (string url)
 Checks the Internet download speed with a given url. More...
 

Public Attributes

SpeedTestCompleteEvent OnSpeedTestComplete
 
double LastDataSizeMB => (double)LastDataSize / 8 / 1024 / 1024
 Returns the last data size in mega bytes (MB). More...
 
double LastSpeedMBps => LastSpeed / 8 / 1024 / 1024
 Returns the last test speed in mega bytes-per-second (MBps). More...
 
bool isPlatformSupported => !Helper.isWebPlatform && !Helper.isWSABasedPlatform
 Indicates if SpeedTest is supporting the current platform. More...
 

Protected Member Functions

override void OnApplicationQuit ()
 
- Protected Member Functions inherited from Crosstales.Common.Util.Singleton< SpeedTest >
virtual void Awake ()
 
virtual void OnDestroy ()
 

Properties

TestSize DataSize [get, set]
 Data size for the speed test. More...
 
string SmallUrl [get, set]
 URL for the small data speed test. More...
 
string MediumUrl [get, set]
 URL for the medium data speed test. More...
 
string LargeUrl [get, set]
 URL for the large data speed test. More...
 
bool RunOnStart [get, set]
 Start at runtime. More...
 
string LastURL [get]
 Returns the last URL. More...
 
long LastDataSize [get]
 Returns the last data size in bits. More...
 
double LastDuration [get]
 Returns the last test duration size seconds. More...
 
double LastSpeed [get]
 Returns the last test speed in bits-per-second (bps). More...
 
bool isBusy [get]
 Returns true if SpeedTest is busy. More...
 
- Properties inherited from Crosstales.Common.Util.Singleton< SpeedTest >
static T Instance [get, protected set]
 Returns the singleton instance of this class. More...
 
bool DontDestroy [get, set]
 Don't destroy gameobject during scene switches. More...
 

Events

TestCompleted OnTestCompleted
 An event triggered whenever the speed test has completed. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Crosstales.Common.Util.Singleton< SpeedTest >
static void CreateInstance (bool searchExistingGameObject=true, bool deleteExistingInstance=false)
 Creates an instance of this object. More...
 
static void DeleteInstance ()
 Deletes the instance of this object. More...
 
- Static Public Attributes inherited from Crosstales.Common.Util.Singleton< SpeedTest >
static string PrefabPath
 Fully qualified prefab path. More...
 
static string GameObjectName
 Name of the gameobject in the scene. More...
 
- Static Protected Attributes inherited from Crosstales.Common.Util.Singleton< SpeedTest >
static T instance
 

Detailed Description

Test the download speed of the Internet connection.

Member Function Documentation

◆ Test() [1/3]

void Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.Test ( )

Checks the Internet download speed with the 'DataSize'-variable.

◆ Test() [2/3]

void Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.Test ( string  url)

Checks the Internet download speed with a given url.

Parameters
urlURL for the test

◆ Test() [3/3]

void Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.Test ( TestSize  size)

Checks the Internet download speed with a given data size.

Parameters
sizeData size for the test

◆ TestCompleted()

delegate void Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.TestCompleted ( string  url,
long  dataSize,
double  duration,
double  speed 
)

Callback to determine whether the speed test has completed.

Member Data Documentation

◆ isPlatformSupported

bool Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.isPlatformSupported => !Helper.isWebPlatform && !Helper.isWSABasedPlatform

Indicates if SpeedTest is supporting the current platform.

Returns
True if SpeedTest supports current platform.

◆ LastDataSizeMB

double Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.LastDataSizeMB => (double)LastDataSize / 8 / 1024 / 1024

Returns the last data size in mega bytes (MB).

Returns
Last data size in mega bytes (MB).

◆ LastSpeedMBps

double Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.LastSpeedMBps => LastSpeed / 8 / 1024 / 1024

Returns the last test speed in mega bytes-per-second (MBps).

Returns
Last test speed in mega bytes-per-second (MBps).

Property Documentation

◆ DataSize

TestSize Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.DataSize
getset

Data size for the speed test.

◆ isBusy

bool Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.isBusy
get

Returns true if SpeedTest is busy.

Returns
True if if SpeedTest is busy.

◆ LargeUrl

string Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.LargeUrl
getset

URL for the large data speed test.

◆ LastDataSize

long Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.LastDataSize
get

Returns the last data size in bits.

Returns
Last data size in bits.

◆ LastDuration

double Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.LastDuration
get

Returns the last test duration size seconds.

Returns
Last test duration size seconds.

◆ LastSpeed

double Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.LastSpeed
get

Returns the last test speed in bits-per-second (bps).

Returns
Last test speed in bits-per-second (bps).

◆ LastURL

string Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.LastURL
get

Returns the last URL.

Returns
Last URL.

◆ MediumUrl

string Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.MediumUrl
getset

URL for the medium data speed test.

◆ RunOnStart

bool Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.RunOnStart
getset

Start at runtime.

◆ SmallUrl

string Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.SmallUrl
getset

URL for the small data speed test.

Event Documentation

◆ OnTestCompleted

TestCompleted Crosstales.OnlineCheck.Tool.SpeedTest.SpeedTest.OnTestCompleted

An event triggered whenever the speed test has completed.


The documentation for this class was generated from the following file:
  • C:/Users/slaub/Unity/assets/OnlineCheck/OnlineCheckPro/Assets/Plugins/crosstales/OnlineCheck/Extras/SpeedTest/Scripts/SpeedTest.cs