2021-05-19 23:27:23 -05:00
|
|
|
<template>
|
2021-06-13 22:16:38 -05:00
|
|
|
<div class="tpsDisplay" v-if="tps !== 'NaN'">
|
2021-05-19 23:27:23 -05:00
|
|
|
TPS: {{ tps }}
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-06-13 22:16:38 -05:00
|
|
|
import Decimal, { formatWhole } from '../../util/bignum';
|
2021-07-24 17:08:52 -05:00
|
|
|
import player from '../../game/player';
|
2021-05-19 23:27:23 -05:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'TPS',
|
|
|
|
computed: {
|
|
|
|
tps() {
|
2021-06-13 22:16:38 -05:00
|
|
|
return formatWhole(Decimal.div(player.lastTenTicks.length, player.lastTenTicks.reduce((acc, curr) => acc + curr, 0)))
|
2021-05-19 23:27:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.tpsDisplay {
|
|
|
|
position: absolute;
|
|
|
|
left: 10px;
|
|
|
|
bottom: 10px;
|
2021-05-22 15:29:06 -05:00
|
|
|
z-index: 100;
|
2021-05-19 23:27:23 -05:00
|
|
|
}
|
|
|
|
</style>
|