70 lines
No EOL
1.2 KiB
C++
70 lines
No EOL
1.2 KiB
C++
#include <iostream>
|
|
#include "LSString.h"
|
|
#include "LSList.h"
|
|
#include "Timer.h"
|
|
|
|
#define RUNS 50U
|
|
#define PAYLOAD "1873612578869"
|
|
|
|
int main()
|
|
{
|
|
printf("---LSString---\n");
|
|
LSString s3;
|
|
const LSString s1 = "187";
|
|
const LSString s2 = "361";
|
|
|
|
{
|
|
s3 = s1 + s2;
|
|
}
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// - STRING
|
|
{
|
|
printf("---LSString---\n");
|
|
printf("Number of runs: %d\n", (int)RUNS);
|
|
Timer tWhole("Complete duration in ");
|
|
for (size_t zRun = 1; zRun <= RUNS; zRun++)
|
|
{
|
|
printf("Run: %2d: ", static_cast<int>(zRun));
|
|
|
|
Timer tSingle("Duration in ");
|
|
LSString s = "12345";
|
|
|
|
for (size_t z = 0; z < 187; z++)
|
|
{
|
|
s.Append(PAYLOAD);
|
|
}
|
|
}
|
|
}
|
|
|
|
// - LIST
|
|
{
|
|
printf("---LSList---\n");
|
|
printf("Number of runs: %d\n", (int) RUNS);
|
|
Timer ttt;
|
|
int i1 = 1187;
|
|
int i2 = 2361;
|
|
int i3 = 3257;
|
|
int i4 = 41337;
|
|
int i5 = 569;
|
|
|
|
LSList<int> liList;
|
|
auto a1 = liList.Append(i1);
|
|
auto a2 = liList.Append(i2);
|
|
auto a3 = liList.Append(i3);
|
|
auto a4 = liList.Append(i4);
|
|
auto a5 = liList.Append(i5);
|
|
|
|
liList.Remove(i1);
|
|
liList.Remove(i5);
|
|
liList.Remove(i3);
|
|
liList.Remove(i4);
|
|
liList.Remove(i2);
|
|
liList.Remove(i1);
|
|
}
|
|
return 0;
|
|
} |